1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-02 06:40:55 +01:00

25672: remove unnecessary Nularg when prompt expanding

to avoid problem with glitch space
This commit is contained in:
Peter Stephenson 2008-09-15 16:18:06 +00:00
parent 6951a1e0b2
commit 14905ddc74
2 changed files with 9 additions and 0 deletions

View file

@ -1,5 +1,8 @@
2008-09-15 Peter Stephenson <pws@csr.com>
* 25672: prompt.c: Resolve string containing only a Nularg
to empty string to avoid interpretation as glitch space.
* 25671: Src/builtin.c, Test/B02typeset.ztst: non-existent
variable in typeset -p should cause status 1.

View file

@ -169,6 +169,12 @@ promptexpand(char *s, int ns, char *rs, char *Rs, unsigned int *txtchangep)
s = dupstring(s);
if (!parsestr(s))
singsub(&s);
/*
* We don't need the special Nularg hack here and we're
* going to be using Nularg for other things.
*/
if (*s == Nularg && s[1] == '\0')
*s = '\0';
/* Ignore errors and status change in prompt substitution */
errflag = olderr;