From 7265bd401d5c68697bfa1405a7e45be80be60595 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 21 Jul 2006 14:53:11 +0000 Subject: * 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 --- object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'object.c') 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++; } -- cgit v1.2.3