diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2009-05-12 19:58:04 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2009-05-12 19:58:04 +0000 |
commit | feb2df4b6345fd7494772b6b560a50a85eb93125 (patch) | |
tree | 5cd0b4cf73881faa442ea5b94d616ba14a86b411 /Src | |
parent | d1abd3e7cf53fc271e9d7c5de4f84ad3e6be42c7 (diff) | |
download | zsh-feb2df4b6345fd7494772b6b560a50a85eb93125.tar.gz zsh-feb2df4b6345fd7494772b6b560a50a85eb93125.tar.xz zsh-feb2df4b6345fd7494772b6b560a50a85eb93125.zip |
26958: Fix reallocation problem in prompts
Diffstat (limited to 'Src')
-rw-r--r-- | Src/prompt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Src/prompt.c b/Src/prompt.c index 20e21e391..e56b70d0b 100644 --- a/Src/prompt.c +++ b/Src/prompt.c @@ -841,6 +841,7 @@ addbufspc(int need) if((bv->bp - bv->buf) + need > bv->bufspc) { int bo = bv->bp - bv->buf; int bo1 = bv->bp1 ? bv->bp1 - bv->buf : -1; + ptrdiff_t bufline_off = bv->bufline ? bv->bufline - bv->buf : -1; if(need & 255) need = (need | 255) + 1; @@ -848,6 +849,8 @@ addbufspc(int need) bv->bp = bv->buf + bo; if(bo1 != -1) bv->bp1 = bv->buf + bo1; + if (bufline_off != -1) + bv->bufline = bv->buf + bufline_off; } } |