about summary refs log tree commit diff
path: root/Src/lex.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-12-16 14:04:16 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-12-16 14:04:16 +0000
commit3c93bfe162216c6d88778271ac0b6499fa2c1ee5 (patch)
treef69b8db6b3a49bf339149a435d1980a59f09195a /Src/lex.c
parent990818d0292e6a80e8b10fc32e6949f3278fcf84 (diff)
downloadzsh-3c93bfe162216c6d88778271ac0b6499fa2c1ee5.tar.gz
zsh-3c93bfe162216c6d88778271ac0b6499fa2c1ee5.tar.xz
zsh-3c93bfe162216c6d88778271ac0b6499fa2c1ee5.zip
zsh-workers/9079
Diffstat (limited to 'Src/lex.c')
-rw-r--r--Src/lex.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/Src/lex.c b/Src/lex.c
index 092d977ed..818ea9f8e 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -470,6 +470,7 @@ add(int c)
 {
     *bptr++ = c;
     if (bsiz == ++len) {
+#if 0
 	int newbsiz;
 
 	newbsiz = bsiz * 8;
@@ -477,6 +478,12 @@ add(int c)
 	    newbsiz *= 2;
 	bptr = len + (tokstr = (char *)hrealloc(tokstr, bsiz, newbsiz));
 	bsiz = newbsiz;
+#endif
+
+	int newbsiz = bsiz + 32;
+
+	bptr = len + (tokstr = (char *)hrealloc(tokstr, bsiz, newbsiz));
+	bsiz = newbsiz;
     }
 }
 
@@ -556,7 +563,7 @@ gettok(void)
     /* word includes the last character read and possibly \ before ! */
     if (dbparens) {
 	len = 0;
-	bptr = tokstr = (char *)ncalloc(bsiz = 256);
+	bptr = tokstr = (char *)ncalloc(bsiz = 32);
 	hungetc(c);
 	cmdpush(CS_MATH);
 	c = dquote_parse(infor ? ';' : ')', 0);
@@ -671,7 +678,7 @@ gettok(void)
 	    }
 	    if (incmdpos) {
 		len = 0;
-		bptr = tokstr = (char *)ncalloc(bsiz = 256);
+		bptr = tokstr = (char *)ncalloc(bsiz = 32);
 		return cmd_or_math(CS_MATH) ? DINPAR : INPAR;
 	    }
 	} else if (d == ')')
@@ -818,7 +825,7 @@ gettokstr(int c, int sub)
     peek = STRING;
     if (!sub) {
 	len = 0;
-	bptr = tokstr = (char *)ncalloc(bsiz = 256);
+	bptr = tokstr = (char *)ncalloc(bsiz = 32);
     }
     for (;;) {
 	int act;