]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(next_file): Don't assume fopen cannot return stdin.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 11 Apr 2005 20:13:10 +0000 (20:13 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 11 Apr 2005 20:13:10 +0000 (20:13 +0000)
src/unexpand.c

index 5e8fe9c0d21178a429277ce45f43698939fa52a4..9b3a07163ab05e0493e5c819457af9c6f567f34f 100644 (file)
@@ -257,7 +257,7 @@ next_file (FILE *fp)
          error (0, errno, "%s", prev_file);
          exit_status = EXIT_FAILURE;
        }
-      if (fp == stdin)
+      if (STREQ (prev_file, "-"))
        clearerr (fp);          /* Also clear EOF.  */
       else if (fclose (fp) != 0)
        {
@@ -268,7 +268,7 @@ next_file (FILE *fp)
 
   while ((file = *file_list++) != NULL)
     {
-      if (file[0] == '-' && file[1] == '\0')
+      if (STREQ (file, "-"))
        {
          have_read_stdin = true;
          prev_file = file;