From 94bfebb3fad44c5418de4ef20493e314344b64c6 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 24 Sep 2003 23:56:11 +0000 Subject: * error.c (rb_warn_m): should not warn if -W0 is specified. [ruby-talk:82675] * util.c (ruby_strtod): skip preceding zeros before counting digits in the mantissa. (ruby-bugs PR#1181) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- util.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'util.c') 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. -- cgit v1.2.3