From 14905ddc74f78b54c75434c8a4d7e029b1933280 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 15 Sep 2008 16:18:06 +0000 Subject: 25672: remove unnecessary Nularg when prompt expanding to avoid problem with glitch space --- ChangeLog | 3 +++ Src/prompt.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index c39b470ce..aeb465af2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-09-15 Peter Stephenson + * 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. diff --git a/Src/prompt.c b/Src/prompt.c index 72ba2e244..36eaca3e9 100644 --- a/Src/prompt.c +++ b/Src/prompt.c @@ -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; -- cgit 1.4.1