On 7/23/19 11:50 PM, enh via Toybox wrote:
> static void do_tac(int fd, char *name)
> {
> struct arg_list *list = NULL;
> - char *c;
> + FILE *fp;
>
> - // Read in lines
> + if (fd == -1) {
> + perror_msg_raw(name);
> + return;
> + }
The infrastructure does that if you pass WARN_ONLY in the flags. (Which
loopfiles() does by default.)
Don't close stdin when they -, it makes the rest of your pipeline unhappy.
(do_lines() in lib/ checks for this)...
Actually, lemme rewrite this to use do_lines(), via the loopfiles_lines() bridge
that's already in lib. And use a dlist since that already has a function to
allocate the wrapper for us and it's trivially reversible...
There, checked in on top of yours. Try now?
Rob
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net