summaryrefslogtreecommitdiff
path: root/src/expand.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-10-24 07:18:18 +0000
committerJim Meyering <jim@meyering.net>2005-10-24 07:18:18 +0000
commit315b42ce8ea7135581e9a33e2993e75d61392566 (patch)
treea72ffa7ec2e3f91ac79fa4a295dc28a7d044408c /src/expand.c
parentd0889c6d1003f5ac33fd0c2bf508fcd6cfad6361 (diff)
downloadcoreutils-315b42ce8ea7135581e9a33e2993e75d61392566.tar.gz
(next_file): Don't assume fopen cannot return stdin.
Diffstat (limited to 'src/expand.c')
-rw-r--r--src/expand.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/expand.c b/src/expand.c
index 863aec933..bf857b0e4 100644
--- a/src/expand.c
+++ b/src/expand.c
@@ -235,7 +235,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)
{
@@ -246,7 +246,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;