diff options
Diffstat (limited to 'src/string.c')
| -rw-r--r-- | src/string.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/string.c b/src/string.c index 61fbd4ded..f75679513 100644 --- a/src/string.c +++ b/src/string.c @@ -2522,15 +2522,10 @@ bad: while (p < end && n < e) prev = *n++ = *p++; while (*p) { if (*p == '_') { - /* remove underscores between digits */ - if (badcheck) { - if (n == buf || !ISDIGIT(prev)) goto bad; - ++p; - if (!ISDIGIT(*p)) goto bad; - } - else { - while (*++p == '_'); - continue; + /* remove an underscore between digits */ + if (n == buf || !ISDIGIT(prev) || (++p, !ISDIGIT(*p))) { + if (badcheck) goto bad; + break; } } prev = *p++; |
