summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y8
1 files changed, 6 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index b7abb1bb58..6b0a124140 100644
--- a/parse.y
+++ b/parse.y
@@ -1520,11 +1520,11 @@ static void
tokadd(c)
char c;
{
+ tokenbuf[tokidx++] = c;
if (tokidx >= toksiz) {
toksiz *= 2;
REALLOC_N(tokenbuf, char, toksiz);
}
- tokenbuf[tokidx++] = c;
}
static int
@@ -1985,7 +1985,11 @@ retry:
c = nextc();
if (c == '\n') sourceline++;
}
- if (ismbchar(c)) c = nextc();
+ if (ismbchar(c)) {
+ c = nextc();
+ if (c == '\n')
+ break;
+ }
}
/* fall through */
case '\n':