diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-03-21 13:33:47 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-03-21 13:33:47 -0300 |
commit | 9284742a11b92dfe4ef011b963240cfa588515cd (patch) | |
tree | 96cc498fcc5ec27546fc0738998319c829df55d0 /lex.c | |
parent | 9704ff4cb14f34077062447d15196d32ace23e95 (diff) | |
download | lua-9284742a11b92dfe4ef011b963240cfa588515cd.tar.gz lua-9284742a11b92dfe4ef011b963240cfa588515cd.tar.bz2 lua-9284742a11b92dfe4ef011b963240cfa588515cd.zip |
better control when growing arrays.
Diffstat (limited to 'lex.c')
-rw-r--r-- | lex.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,4 +1,4 @@ | |||
1 | char *rcs_lex = "$Id: lex.c,v 2.30 1996/03/14 15:17:28 roberto Exp roberto $"; | 1 | char *rcs_lex = "$Id: lex.c,v 2.31 1996/03/19 16:50:24 roberto Exp roberto $"; |
2 | 2 | ||
3 | 3 | ||
4 | #include <ctype.h> | 4 | #include <ctype.h> |
@@ -83,8 +83,7 @@ void luaI_addReserved (void) | |||
83 | static void growtext (void) | 83 | static void growtext (void) |
84 | { | 84 | { |
85 | int size = yytextLast - yytext; | 85 | int size = yytextLast - yytext; |
86 | textsize *= 2; | 86 | textsize = growvector(&yytext, textsize, char, lexEM, MAX_WORD); |
87 | yytext = growvector(yytext, textsize, char); | ||
88 | yytextLast = yytext + size; | 87 | yytextLast = yytext + size; |
89 | } | 88 | } |
90 | 89 | ||