Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: promptsubst and empty variables



Peter Stephenson <pws@xxxxxxx>:
[...]
> I hope, actually, it's dupstring(nulstring), or substitution is a bit
> broken.
> 
> I don't think we need the Nularg in this case since although the string is
> metafied we're not doing anything special with tokens.  However, I've never
> understood what this was for in the first place, so I may have missed
> something.  If I have, however, we're not going to find out without trying
> it.
[...]
> +	/*
> +	 * 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';

I just gave this a try.
And it fixes the problem for me. For my test case as well as my real
prompt - which wasn't struck by the problem, but this change does not
break anything, AFAICS.

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925



Messages sorted by: Reverse Date, Date, Thread, Author