]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(get_input_fstatus): Fix typo: `stat' was being
authorJim Meyering <jim@meyering.net>
Sun, 20 Jul 2003 21:13:04 +0000 (21:13 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 20 Jul 2003 21:13:04 +0000 (21:13 +0000)
invoked with a null pointer when there were no file arguments.

src/wc.c

index 8f3f6791c8abc9925b5faef3f77e16b019e913d5..8647fd77dee3e9e5940d3b04a58e3813a91c7662 100644 (file)
--- a/src/wc.c
+++ b/src/wc.c
@@ -554,7 +554,7 @@ get_input_fstatus (int nfiles, char * const *file)
       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));
     }