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

Re: P modify in history event



On Tue, 2019-11-19 at 19:03 +0000, Daniel Shahaf wrote:
> Peter Stephenson wrote on Tue, 19 Nov 2019 18:21 +00:00:
> > 
> > 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.
> How about this, then?

That looks sensible.

pws



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