summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-07-15 05:10:15 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-07-15 05:10:15 +0000
commit4b8171cd7ac73f9dfaf3873ee5a964e6801be9e4 (patch)
tree5ce006f6ee2ae6cabc619acf35c3179dfc67a2b7
parent09ce45fd10c53b27023ebad7e9bc25cb68b3f06b (diff)
downloadbusybox-w32-4b8171cd7ac73f9dfaf3873ee5a964e6801be9e4.tar.gz
busybox-w32-4b8171cd7ac73f9dfaf3873ee5a964e6801be9e4.tar.bz2
busybox-w32-4b8171cd7ac73f9dfaf3873ee5a964e6801be9e4.zip
tee: "-" is a name for stdout, handle it that way
-rw-r--r--coreutils/tee.c11
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: