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

Re: treatment of empty strings - why is this not a bug?



Greg Klanderman wrote:
> I still do not understand why I get exactly two empty strings no
> matter how many colons I have in the input string: I would expect
> none based on the description you cited.
> 
> phl% x=::::: && for v in "${(s-:-)x}" ; do echo "v= =>$v<=" ; done
> v= =><=
> v= =><=
> phl% x=: && for v in "${(s-:-)x}" ; do echo "v= =>$v<=" ; done 
> v= =><=
> v= =><=

It's to do with the code that joins parameters with what's next to them,
which is why the RC_EXPAND_PARAM option is different.  Quite why it does
what it does I don't understand either, however; but I don't really
understand this particular piece of traditional behaviour at all.
If I were changing it, rather than try to sanitize it I would simply
remove it.

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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