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

Re: mkdir builtin and $'\0'



On Tue, 18 Aug 2015 16:07:33 +0100
Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> On Tue, 18 Aug 2015 15:21:45 +0100
> Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> > This seems to work for strftime and primt -P %D and the tests pass.
> 
> I think there's a pre-existing confusion here, which is that we should
> really treat ztrftime return value of both 0 and -1 as failure.  The 0
> comes from strftime(), which returns the number of characters it's
> succesfully converted (the manual helpfully says 0 "doesn't necessarily
> indicate an error", just that it coverted nothing); the -1 was a local
> enhancement.

Sigh.  No, I've got it now.  I think.

The -1 was supposed to be an enhancement so we really *can* detect
whether strftime() failed or not, by detecting whether strftime() output
something and then later gave up, or actually didn't output anything.
Dunno how robust it is, but I'll keep to it after all.

pws



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