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

Re: Why sourcing a file is not faster than doing a loop with eval, zle -N



On Mon, 19 Jun 2017 20:28:35 +0100
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> How about something like this?  As far as I can tell, fgets is designed
> from the ground up as Gets Done Properly, so if you have it on your
> system it will work correctly.  I can't think of a case where this
> wouldn't do the right thing --- fgets will read at most one line and if
> it does we were going to get the big STDIO overhead at that point
> anyway.

I know what the problem with it is --- we can't tell the difference
betwen a terminating '\0' and a '\0' that's part of the input stream.

pws



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