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

Re: P modify in history event



On Tue, 2019-11-19 at 18:00 +0000, Daniel Shahaf wrote:
> Can «zgetcwd()» return an empty string?  If that's possible, the
> condition will be undefined behaviour («""[-1]»).

Not in a sane world, but there are cases where we can't work out the
current directory.  I think we return "." then, in fact.  But a bit of
safety probably wouldn't hurt --- applying [-1] to functions arguably
isn't top class style.

pws


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