[Toybox] [PATCH] xputsl: write to stdout, not stdin!

enh enh at google.com
Fri Aug 21 11:09:13 PDT 2020


no, that would be if you were calling fflush(). xflush() takes a bool.

being explicit with NULL or true -- which i do anyway, because life is
confusing enough as it is -- wouldn't have stopped C from just implicitly
convert everything anyway, but maybe xflush() should be broken in two
(and/or changed to actually take a FILE*), with the "no, don't really
flush" being private to xwrap --- i only see one caller outside of xwrap.c
and that's sh.c and i think that's actually another instance of this bug?

anyway, a minimal patch that fixes grep sent to mailing list.

(this is github being helpful, btw --- i haven't even tried to sync AOSP
yet. i'm just looking at the commits with the red X next to them on
https://github.com/landley/toybox/commits/master. )



On Wed, Aug 19, 2020 at 11:59 PM Rob Landley <rob at landley.net> wrote:

> On 8/19/20 7:33 PM, enh via Toybox wrote:
> >
> > This is why the tests have been failing since
> > 42303209f44a335025b9cd1dbe5dd2f3069f2e99.
>
> Blah. That first 0 is NULL, not stdin. (Mixing ansi stdio.h and filehandle
> contexts because it flushes one so the other is safe to do...)
>
> Rob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20200821/a47e3722/attachment-0001.htm>


More information about the Toybox mailing list