summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-08-27 19:05:24 +0000
committerJim Meyering <jim@meyering.net>2005-08-27 19:05:24 +0000
commite2ea930478bc72921454911b0ef495c903e85756 (patch)
tree1d7d1875f89376507f50659a5ff07bf2040d0b6c /src
parent1cf9fe29811a6f1ae034f63f6348de48b9351b77 (diff)
downloadcoreutils-e2ea930478bc72921454911b0ef495c903e85756.tar.xz
Go ahead and leave the patch in (i.e., revert
today's change). It doesn't cause a problem after all, since --exclude-from=- is always handled before --files0-from=F.
Diffstat (limited to 'src')
-rw-r--r--src/du.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/du.c b/src/du.c
index a8fb2ed10..df5088e30 100644
--- a/src/du.c
+++ b/src/du.c
@@ -928,8 +928,6 @@ main (int argc, char **argv)
if (files_from)
{
- FILE *istream;
-
/* When using --files0-from=F, you may not specify any files
on the command-line. */
if (optind < argc)
@@ -940,14 +938,13 @@ main (int argc, char **argv)
usage (EXIT_FAILURE);
}
- istream = (STREQ (files_from, "-") ? stdin : fopen (files_from, "r"));
- if (istream == NULL)
+ if (! (STREQ (files_from, "-") || freopen (files_from, "r", stdin)))
error (EXIT_FAILURE, errno, _("cannot open %s for reading"),
quote (files_from));
readtokens0_init (&tok);
- if (! readtokens0 (istream, &tok) || fclose (istream) != 0)
+ if (! readtokens0 (stdin, &tok) || fclose (stdin) != 0)
error (EXIT_FAILURE, 0, _("cannot read file names from %s"),
quote (files_from));