ok schwarze@

Side note: That bug was introduced on July 23, 1999 by aaron@.
Congratulations Craig, you found a bug that was more than 15 years old.
If only bugs would eventually die from decrepitude...
But it seems they are almost immortal.


Ted Unangst wrote on Tue, Oct 07, 2014 at 02:20:34PM -0400:
> On Tue, Oct 07, 2014 at 18:37, Craig R. Skinner wrote:

>> I'm seeing head return 0 on failures:

> Index: head.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/head/head.c,v
> retrieving revision 1.16
> diff -u -p -r1.16 head.c
> --- head.c    26 Nov 2013 13:21:17 -0000      1.16
> +++ head.c    7 Oct 2014 18:19:03 -0000
> @@ -52,6 +52,7 @@ main(int argc, char *argv[])
>       int     ch, firsttime;
>       long    linecnt = 10;
>       char    *p = NULL;
> +     int     status = 0;
>  
>       /* handle obsolete -number syntax */
>       if (argc > 1 && argv[1][0] == '-' &&
> @@ -84,10 +85,11 @@ main(int argc, char *argv[])
>       for (firsttime = 1; ; firsttime = 0) {
>               if (!*argv) {
>                       if (!firsttime)
> -                             exit(0);
> +                             exit(status);
>               } else {
>                       if (!freopen(*argv, "r", stdin)) {
>                               warn("%s", *argv++);
> +                             status = 1;
>                               continue;
>                       }
>                       if (argc > 1) {

Reply via email to