diff options
-rw-r--r-- | coreutils/tee.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/coreutils/tee.c b/coreutils/tee.c index b38801755..8a4128591 100644 --- a/coreutils/tee.c +++ b/coreutils/tee.c | |||
@@ -50,10 +50,13 @@ int tee_main(int argc, char **argv) | |||
50 | files[0] = stdout; | 50 | files[0] = stdout; |
51 | goto GOT_NEW_FILE; | 51 | goto GOT_NEW_FILE; |
52 | do { | 52 | do { |
53 | *fp = fopen_or_warn(*argv, mode); | 53 | *fp = stdout; |
54 | if (*fp == NULL) { | 54 | if (NOT_LONE_DASH(*argv)) { |
55 | retval = EXIT_FAILURE; | 55 | *fp = fopen_or_warn(*argv, mode); |
56 | continue; | 56 | if (*fp == NULL) { |
57 | retval = EXIT_FAILURE; | ||
58 | continue; | ||
59 | } | ||
57 | } | 60 | } |
58 | *np = *argv++; | 61 | *np = *argv++; |
59 | GOT_NEW_FILE: | 62 | GOT_NEW_FILE: |