summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/util.c b/util.c
index 9b058e6114..456704492a 100644
--- a/util.c
+++ b/util.c
@@ -757,6 +757,13 @@ ruby_strtod(string, endPtr)
sign = FALSE;
}
+ /* skip preceding zeros */
+ if (*p == '0') {
+ while (*p == '0')
+ p++;
+ p--;
+ }
+
/*
* Count the number of digits in the mantissa (including the decimal
* point), and also locate the decimal point.