summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorYukihiro Matsumoto <matz@ruby-lang.org>1997-12-09 17:54:56 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-17 22:09:33 +0900
commit66541bbb3630a5c512f8012c52ae777ab83beba5 (patch)
treebe1431b56b485de6cb1da065bb2161551872820d /parse.y
parentfb0fe24512d1796f794306768ddac37566e9a209 (diff)
version 1.0-971209v1_0_971209
https://cache.ruby-lang.org/pub/ruby/1.0/ruby-1.0-971209.tar.gz Tue Dec 9 17:54:56 1997 Yukihiro Matsumoto <matz@netlab.co.jp> * version 1.0-971209 * sample/ruby-mode.el (ruby-expr-beg): forgot to handle modifiers. * parse.y (tokadd): token buffer overrun.
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':