diff options
author | Jim Meyering <jim@meyering.net> | 2005-04-05 11:40:53 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2005-04-05 11:40:53 +0000 |
commit | dce4a77a9931d921fbc0f0578ebc8041cce5709e (patch) | |
tree | b320093024445b8c618c7464d48b523cc3108249 | |
parent | 78eefa7b187161dd233817f921e1c32701a2a898 (diff) | |
download | coreutils-dce4a77a9931d921fbc0f0578ebc8041cce5709e.tar.xz |
(tee): When closing files, do not close stdout,
leave this job to close_stdout() instead.
From Dmitry V. Levin.
-rw-r--r-- | src/tee.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -204,7 +204,8 @@ tee (int nfiles, const char **files) /* Close the files, but not standard output. */ for (i = 1; i <= nfiles; i++) - if (descriptors[i] && fclose (descriptors[i]) != 0) + if (!STREQ (files[i], "-") + && descriptors[i] && fclose (descriptors[i]) != 0) { error (0, errno, "%s", files[i]); ok = false; |