From: Jim Meyering Date: Mon, 24 Oct 2005 07:18:18 +0000 (+0000) Subject: (next_file): Don't assume fopen cannot return stdin. X-Git-Tag: v6.0~1488 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=315b42ce8ea7135581e9a33e2993e75d61392566;p=thirdparty%2Fcoreutils.git (next_file): Don't assume fopen cannot return stdin. --- diff --git a/src/expand.c b/src/expand.c index 863aec933c..bf857b0e45 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;