mirror of
https://github.com/sheumann/hush.git
synced 2024-09-12 00:55:11 +00:00
tee: "-" is a name for stdout, handle it that way
This commit is contained in:
parent
09ce45fd10
commit
4b8171cd7a
@ -50,11 +50,14 @@ int tee_main(int argc, char **argv)
|
|||||||
files[0] = stdout;
|
files[0] = stdout;
|
||||||
goto GOT_NEW_FILE;
|
goto GOT_NEW_FILE;
|
||||||
do {
|
do {
|
||||||
|
*fp = stdout;
|
||||||
|
if (NOT_LONE_DASH(*argv)) {
|
||||||
*fp = fopen_or_warn(*argv, mode);
|
*fp = fopen_or_warn(*argv, mode);
|
||||||
if (*fp == NULL) {
|
if (*fp == NULL) {
|
||||||
retval = EXIT_FAILURE;
|
retval = EXIT_FAILURE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
*np = *argv++;
|
*np = *argv++;
|
||||||
GOT_NEW_FILE:
|
GOT_NEW_FILE:
|
||||||
setbuf(*fp++, NULL); /* tee must not buffer output. */
|
setbuf(*fp++, NULL); /* tee must not buffer output. */
|
||||||
|
Loading…
Reference in New Issue
Block a user