Jim Meyering <[EMAIL PROTECTED]> writes:

> Not that it matters, but in some unusual cases,
> the new widths are worse than the old:
> 
>   $ dd bs=1 seek=1G of=b < /dev/null 2> /dev/null
>   $ ./wc -lw b
>            0          0 b
>   $ wc -lw b
>         0       0 b

Yes, that's true.  The only way to print minimal widths is to run the
'wc' algorithm on all the input files, collect the outputs, and then
print them all at the end.  I've been meaning to do that with df at
some point (since df suffers from column overflow more), but it does
have some disconcerting effects, since zero output is printed until
it's all ready.

Anyway, I noticed on glitch in the merged version; here's a patch.

2003-07-20  Paul Eggert  <[EMAIL PROTECTED]>

        * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
        invoked with a null pointer when there were no file arguments.

--- wc.c.~1.88.~        Sun Jul 20 13:50:35 2003
+++ wc.c        Sun Jul 20 13:58:40 2003
@@ -554,7 +554,7 @@ get_input_fstatus (int nfiles, char * co
       int i;
 
       for (i = 0; i < nfiles; i++)
-       fstatus[i].failed = (file[i] && STREQ (file[i], "-")
+       fstatus[i].failed = (! file[i] || STREQ (file[i], "-")
                             ? fstat (STDIN_FILENO, &fstatus[i].st)
                             : stat (file[i], &fstatus[i].st));
     }



_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to