diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-29 12:25:44 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-29 12:25:44 +0000 |
commit | ace1ad2607f7b45589ed1d1cc2518eef2d169f0e (patch) | |
tree | 2e84465ca4dbb914f09fcfb9d558a24a21149615 /util.c | |
parent | 96f0473ef6e357e6f9f360540019834848a2384f (diff) |
merges r29073 from trunk into ruby_1_9_2.
--
* util.c (ruby_strtod): make sure to have digit-sequence after 'p'
for hexadecimal-floating-constant. [ruby-dev:42105]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@29373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -2139,11 +2139,15 @@ break2: if (abs(dsign) == 1) s++; else dsign = 1; - for (nd = 0; (c = *s) >= '0' && c <= '9'; s++) { + nd = 0; + c = *s; + if (c < '0' || '9' < c) goto ret0; + do { nd *= 10; nd += c; nd -= '0'; - } + c = *++s; + } while ('0' <= c && c <= '9'); dval(rv) = ldexp(adj, nd * dsign); } else { |