summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-04-11 20:13:10 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-04-11 20:13:10 +0000
commit45e6c262b923608e06f900acb62237cd5e2e869d (patch)
tree7cb83f6c4010ad183611c66be5c231b878542a38 /src
parent8e8520b0ba3538698510b6a31d764737f92b1222 (diff)
downloadcoreutils-45e6c262b923608e06f900acb62237cd5e2e869d.tar.xz
(next_file): Don't assume fopen cannot return stdin.
Diffstat (limited to 'src')
-rw-r--r--src/unexpand.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/unexpand.c b/src/unexpand.c
index 5e8fe9c0d..9b3a07163 100644
--- a/src/unexpand.c
+++ b/src/unexpand.c
@@ -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;