[Toybox] [PATCH] head: Fix not -123 options
Felix Janda
felix.janda at posteo.de
Sat Mar 28 16:17:40 PDT 2015
Rob Landley wrote:
> On 03/28/2015 04:31 PM, Felix Janda wrote:
> > ---
> > toys/posix/head.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/toys/posix/head.c b/toys/posix/head.c
> > index 42f945b..8e77b01 100644
> > --- a/toys/posix/head.c
> > +++ b/toys/posix/head.c
> > @@ -56,6 +56,7 @@ void head_main(void)
> > if (arg && *arg == '-' && arg[1]) {
> > TT.lines = atolx(arg+1);
> > toys.optc--;
> > + toys.optargs++;
> > }
> > - loopfiles(toys.optargs+!!arg, do_head);
> > + loopfiles(toys.optargs, do_head);
> > }
>
> Actually I try to avoid modifying toys.optargs in case I expand nofork()
> stuff in future and want to free it on return.
>
> When you say "fix", could you give me a test case showing the failure?
head -n 1 file
Felix
1427584660.0
More information about the Toybox
mailing list