stdout was being overwritten in the list of outputs
authorJim Bloom <bloom@ucbvax.Berkeley.EDU>
Fri, 25 Oct 1985 09:56:44 +0000 (01:56 -0800)
committerJim Bloom <bloom@ucbvax.Berkeley.EDU>
Fri, 25 Oct 1985 09:56:44 +0000 (01:56 -0800)
SCCS-vsn: usr.bin/tee/tee.c 5.2

usr/src/usr.bin/tee/tee.c

index 2c9f04a..232b257 100644 (file)
@@ -11,7 +11,7 @@ char copyright[] =
 #endif not lint
 
 #ifndef lint
 #endif not lint
 
 #ifndef lint
-static char *sccsid = "@(#)tee.c       5.1 (Berkeley) %G%";
+static char *sccsid = "@(#)tee.c       5.2 (Berkeley) %G%";
 #endif
 /*
  * tee-- pipe fitting
 #endif
 /*
  * tee-- pipe fitting
@@ -47,7 +47,7 @@ main(argc,argv)
                fprintf(stderr, "tee: Out of memory.\n");
                exit(-1);
        }
                fprintf(stderr, "tee: Out of memory.\n");
                exit(-1);
        }
-       *lastf = stdout;        /* default */
+       *lastf++ = stdout;      /* default */
        for (; argc > 0; argc--, argv++) {
                *lastf = fopen(argv[0], aflag ? "a" : "w");
                if (*lastf == NULL)
        for (; argc > 0; argc--, argv++) {
                *lastf = fopen(argv[0], aflag ? "a" : "w");
                if (*lastf == NULL)