mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
(next_file): Don't assume fopen cannot return stdin.
This commit is contained in:
1 parent
8e8520b0ba
commit
45e6c262b9
1 file changed
+2
-2
+2
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user