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:
329448f
)
(dc_parse_file): Don't assume fopen does not return stdin.
author
Paul Eggert
<eggert@cs.ucla.edu>
Mon, 11 Apr 2005 20:07:22 +0000
(20:07 +0000)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Mon, 11 Apr 2005 20:07:22 +0000
(20:07 +0000)
src/dircolors.c
patch
|
blob
|
history
diff --git
a/src/dircolors.c
b/src/dircolors.c
index
5f9df11
..
1253980
100644
(file)
--- a/
src/dircolors.c
+++ b/
src/dircolors.c
@@
-376,8
+376,9
@@
dc_parse_file (const char *filename)
{
FILE *fp;
bool ok;
+ bool is_stdin = STREQ (filename, "-");
- if (
STREQ (filename, "-")
)
+ if (
is_stdin
)
{
have_read_stdin = true;
fp = stdin;
@@
-398,7
+399,7
@@
dc_parse_file (const char *filename)
ok = dc_parse_stream (fp, filename);
- if (
fp != stdin && fclose (fp) == EOF
)
+ if (
!is_stdin && fclose (fp) != 0
)
{
error (0, errno, "%s", quote (filename));
return false;