summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-21 14:53:11 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-21 14:53:11 +0000
commit7265bd401d5c68697bfa1405a7e45be80be60595 (patch)
tree4deef5748eafba0f3b566cec266be7d802e67758 /object.c
parent252d273832fd0baaed91f01d96c5381ac4707fef (diff)
* object.c (rb_cstr_to_dbl): "9_e8" should consider "_e8" as
trailing garbage so that it should return 9.0. [ruby-dev:29088] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/object.c b/object.c
index 0a02e0f7f9..398dc6a1a7 100644
--- a/object.c
+++ b/object.c
@@ -2071,10 +2071,10 @@ rb_cstr_to_dbl(const char *p, int badcheck)
/* remove underscores between digits */
if (n == buf || !ISDIGIT(n[-1])) goto bad;
while (*++p == '_');
- if (badcheck) {
- if (!ISDIGIT(*p)) goto bad;
+ if (!ISDIGIT(*p)) {
+ if (badcheck) goto bad;
+ break;
}
- continue;
}
*n++ = *p++;
}