diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2011-12-14 01:30:08 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2011-12-14 01:31:10 +0100 |
commit | 3e739c6befbab45a3b6e460b5ce26ac0359155ec (patch) | |
tree | 0cc28cfd413d9f2a3c5c13da83606f2829e641ba /Src/lex.c | |
parent | 00f335b142707b7f9e3531714b7a3bf5b377dcc1 (diff) | |
parent | 79f2f7fa2ce18552869afa33f1d0d42cf4191b04 (diff) | |
download | zsh-3e739c6befbab45a3b6e460b5ce26ac0359155ec.tar.gz zsh-3e739c6befbab45a3b6e460b5ce26ac0359155ec.zip |
Merge commit 'zsh-4.3.14' into debian
Diffstat (limited to 'Src/lex.c')
-rw-r--r-- | Src/lex.c | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -567,22 +567,14 @@ add(int c) { *bptr++ = c; if (bsiz == ++len) { -#if 0 - int newbsiz; - - newbsiz = bsiz * 8; - while (newbsiz < inbufct) - newbsiz *= 2; - bptr = len + (tokstr = (char *)hrealloc(tokstr, bsiz, newbsiz)); - bsiz = newbsiz; -#endif - int newbsiz = bsiz * 2; if (newbsiz > inbufct && inbufct > bsiz) newbsiz = inbufct; bptr = len + (tokstr = (char *)hrealloc(tokstr, bsiz, newbsiz)); + /* len == bsiz, so bptr is at the start of newly allocated memory */ + memset(bptr, 0, newbsiz - bsiz); bsiz = newbsiz; } } |