← Commit list

8ddb6410e

Denis Vlasenko
Denis Vlasenko
2008-07-16
FAILED Duration: 17s

Subject

tee: fix infinite looping on open error (echo asd | tee "")

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/tee.c+3 -1
@@ -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 */