bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] gawk -h != gawk --help


From: arnold
Subject: Re: [bug-gawk] gawk -h != gawk --help
Date: Mon, 29 Sep 2014 21:04:30 -0600
User-agent: Heirloom mailx 12.4 7/29/08

"Andrew J. Schorr" <address@hidden> wrote:

> Hi,
>
> On Sun, Sep 28, 2014 at 11:32:13PM +0200, Joep van Delft wrote:
> > % gawk -h
> > gawk: option requires an argument -- h
> > (...)
> > 
> > % echo $?
> > 1
> > 
> > Yet, 
> > 
> > % gawk --help
> > (...)
> > 
> > % echo $?
> > 0
> > 
> > Is that intentional? 
>
> Thanks for the report.  It seems that there is a minor bug in main.c.
> The "optlist" string is set as follows:
>
>       const char *optlist = "+F:f:v:W;bcCd::D::e:E:gh:i:l:L:nNo::Op::MPrStVY";
>
> This contrasts with
>
>         { "help",               no_argument,            NULL,   'h' },
>
> There seems to be a stray colon after the "h" in optlist.  If that
> is removed, the exit status will be zero in both cases.
>
> The attached patch seems to fix the problem.
>
> Regards,
> Andy

Got it in one, Andy. Please push that to gawk-4.1-stable. I can
merge it to master it if you want.

Joep - thanks for the bug report.

Arnold



reply via email to

[Prev in Thread] Current Thread [Next in Thread]