projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd9874d
)
tee: fix infinite looping on open error (echo asd | tee "")
author
Denis Vlasenko
<vda.linux@googlemail.com>
Wed, 16 Jul 2008 07:34:00 +0000
(07:34 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Wed, 16 Jul 2008 07:34:00 +0000
(07:34 -0000)
coreutils/tee.c
patch
|
blob
|
history
diff --git
a/coreutils/tee.c
b/coreutils/tee.c
index 8a4128591c4b8af0adabad0afe2b765b78112f58..dc947c9358270f2d360812d560122e46a473b9e2 100644
(file)
--- a/
coreutils/tee.c
+++ b/
coreutils/tee.c
@@
-55,12
+55,14
@@
int tee_main(int argc, char **argv)
*fp = fopen_or_warn(*argv, mode);
if (*fp == NULL) {
retval = EXIT_FAILURE;
+ argv++;
continue;
}
}
*np = *argv++;
GOT_NEW_FILE:
- setbuf(*fp++, NULL); /* tee must not buffer output. */
+ setbuf(*fp, NULL); /* tee must not buffer output. */
+ fp++;
np++;
} while (*argv);
/* names[0] will be filled later */