1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-18 21:14:11 +01:00

22464: bad recursion if error in prompt substitution

This commit is contained in:
Peter Stephenson 2006-05-26 22:43:51 +00:00
parent 7c87409d62
commit 09aaf50cda
2 changed files with 14 additions and 4 deletions

@ -1,3 +1,8 @@
2006-05-26 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 22464: Src/Zle/zle_main.c: an error in prompt substitution could
cause bad recursion karma.
2006-05-25 Wayne Davison <wayned@users.sourceforge.net>
* 22454, Hideki ONO: Completion/Unix/Command/_ls: added support

@ -1509,10 +1509,15 @@ recursiveedit(UNUSED(char **args))
void
reexpandprompt(void)
{
free(lpromptbuf);
lpromptbuf = promptexpand(raw_lp ? *raw_lp : NULL, 1, NULL, NULL);
free(rpromptbuf);
rpromptbuf = promptexpand(raw_rp ? *raw_rp : NULL, 1, NULL, NULL);
static reexpanding;
if (!reexpanding++) {
free(lpromptbuf);
lpromptbuf = promptexpand(raw_lp ? *raw_lp : NULL, 1, NULL, NULL);
free(rpromptbuf);
rpromptbuf = promptexpand(raw_rp ? *raw_rp : NULL, 1, NULL, NULL);
}
reexpanding--;
}
/**/