summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-30 11:20:03 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-30 11:20:03 +0000
commit8429f2be9fd3ac4bcc97580fece853fed6fc09bc (patch)
treef42bfb216f3178bfe5f150f2b3be5dc99d95b0ac /bignum.c
parent9ac5a0ca4ded8a8a933cc222b82b69d295b9b323 (diff)
adjustment
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/bignum.c b/bignum.c
index eae1f7e735..f8400b0f49 100644
--- a/bignum.c
+++ b/bignum.c
@@ -470,16 +470,15 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
break;
}
if (*str == '0') { /* squeeze preceding 0s */
- int nn = 0;
- while ((c = *++str) == '0' || c == '_') {
- if (c == '_') {
- nn++;
- if (nn >= 2)
- break;
- } else
- nn = 0;
- }
- if (!(c = *str) || ISSPACE(c)) --str;
+ int us = 0;
+ while ((c = *++str) == '0' || c == '_') {
+ if (c == '_') {
+ if (++us >= 2)
+ break;
+ } else
+ us = 0;
+ }
+ if (!(c = *str) || ISSPACE(c)) --str;
}
c = *str;
c = conv_digit(c);