mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-10-02 00:41:44 +02:00
20966: fix crash in execute-named-command
This commit is contained in:
parent
6ab396f5fb
commit
15b78be794
@ -1,3 +1,8 @@
|
||||
2005-03-11 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 20966: Src/Zle/zle_misc.c: need to copy strings to avoid
|
||||
crash in completion for execute-named-command.
|
||||
|
||||
2005-03-09 Clint Adams <clint@zsh.org>
|
||||
|
||||
* 20961: Completion/Unix/Command/_baz: fix completion of status and
|
||||
|
@ -911,8 +911,9 @@ executenamedcommand(char *prmt)
|
||||
showinglist = 0;
|
||||
zmult = zmultsav;
|
||||
} else if (!nextnode(firstnode(namedcmdll))) {
|
||||
ZLE_STRING_T ztmp = stringaszleline(peekfirst(namedcmdll),
|
||||
&len, NULL);
|
||||
char *peekstr = ztrdup(peekfirst(namedcmdll));
|
||||
ZLE_STRING_T ztmp = stringaszleline(peekstr, &len, NULL);
|
||||
zsfree(peekstr);
|
||||
ZS_memcpy(ptr = cmdbuf, ztmp, len);
|
||||
ptr += len;
|
||||
free(ztmp);
|
||||
@ -920,8 +921,9 @@ executenamedcommand(char *prmt)
|
||||
goto unambiguous;
|
||||
} else {
|
||||
int ltmp;
|
||||
ZLE_STRING_T ztmp = stringaszleline(peekfirst(namedcmdll),
|
||||
<mp, NULL);
|
||||
char *peekstr = ztrdup(peekfirst(namedcmdll));
|
||||
ZLE_STRING_T ztmp = stringaszleline(peekstr, <mp, NULL);
|
||||
zsfree(peekstr);
|
||||
ZS_memcpy(cmdbuf, ztmp, ltmp);
|
||||
free(ztmp);
|
||||
ptr = cmdbuf + namedcmdambig;
|
||||
|
Loading…
Reference in New Issue
Block a user