aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-15 06:04:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-15 06:04:56 +0000
commita258d6f4157908b8360ee005b20bddb0969ce0aa (patch)
tree2c32ef641240734f1ad166f242e48f79b1b39bf8
parent375aedbfb4d1a93ab2d9573fcb34cf4d6c474de2 (diff)
downloadruby-a258d6f4157908b8360ee005b20bddb0969ce0aa.tar.gz
* util.c (ruby_strtod): no need to check same digit for hexdigit
twice. [ruby-dev:45363][Bug #6146] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--util.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 3d0f19dc04..7528cef919 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-Thu Mar 15 15:04:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Mar 15 15:04:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * util.c (ruby_strtod): no need to check same digit for hexdigit
+ twice. [ruby-dev:45363][Bug #6146]
* parse.y (sym_check_asciionly): check ascii compatibility before
scanning for code range.
diff --git a/util.c b/util.c
index 39ec3e9783..fca9e67541 100644
--- a/util.c
+++ b/util.c
@@ -1977,8 +1977,11 @@ break2:
nd0 = -4;
if (!*++s || !(s1 = strchr(hexdigit, *s))) goto ret0;
- while (*s == '0') s++;
- if ((s1 = strchr(hexdigit, *s)) != NULL) {
+ if (*s == '0') {
+ while (*++s == '0');
+ s1 = strchr(hexdigit, *s);
+ }
+ if (s1 != NULL) {
do {
adj += aadj * ((s1 - hexdigit) & 15);
nd0 += 4;