svn commit: trunk/busybox/coreutils

vda at busybox.net vda at busybox.net
Tue Jul 15 05:10:16 UTC 2008


Author: vda
Date: 2008-07-14 22:10:15 -0700 (Mon, 14 Jul 2008)
New Revision: 22831

Log:
tee: "-" is a name for stdout, handle it that way



Modified:
   trunk/busybox/coreutils/tee.c


Changeset:
Modified: trunk/busybox/coreutils/tee.c
===================================================================
--- trunk/busybox/coreutils/tee.c	2008-07-14 21:29:35 UTC (rev 22830)
+++ trunk/busybox/coreutils/tee.c	2008-07-15 05:10:15 UTC (rev 22831)
@@ -50,10 +50,13 @@
 	files[0] = stdout;
 	goto GOT_NEW_FILE;
 	do {
-		*fp = fopen_or_warn(*argv, mode);
-		if (*fp == NULL) {
-			retval = EXIT_FAILURE;
-			continue;
+		*fp = stdout;
+		if (NOT_LONE_DASH(*argv)) {
+			*fp = fopen_or_warn(*argv, mode);
+			if (*fp == NULL) {
+				retval = EXIT_FAILURE;
+				continue;
+			}
 		}
 		*np = *argv++;
  GOT_NEW_FILE:




More information about the busybox-cvs mailing list