projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab860aa
)
(paste_serial): Don't assume fopen does not return stdin.
author
Paul Eggert
<eggert@cs.ucla.edu>
Mon, 11 Apr 2005 20:09:22 +0000
(20:09 +0000)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Mon, 11 Apr 2005 20:09:22 +0000
(20:09 +0000)
src/paste.c
patch
|
blob
|
history
diff --git
a/src/paste.c
b/src/paste.c
index 139ac599a5f7f9fa523af28457d148032aa978ef..8f51c521c82510b8c054e89e351a0a0278669eff 100644
(file)
--- a/
src/paste.c
+++ b/
src/paste.c
@@
-336,7
+336,8
@@
paste_serial (size_t nfiles, char **fnamptr)
for (; nfiles; nfiles--, fnamptr++)
{
int saved_errno;
- if (STREQ (*fnamptr, "-"))
+ bool is_stdin = STREQ (*fnamptr, "-");
+ if (is_stdin)
{
have_read_stdin = true;
fileptr = stdin;
@@
-394,7
+395,7
@@
paste_serial (size_t nfiles, char **fnamptr)
error (0, saved_errno, "%s", *fnamptr);
ok = false;
}
- if (
fileptr ==
stdin)
+ if (
is_
stdin)
clearerr (fileptr); /* Also clear EOF. */
else if (fclose (fileptr) == EOF)
{