commit cacf16907d60b1450a87868913052cb6dd375b24 from: Mark Jamsek via: Thomas Adam date: Tue Sep 06 15:49:32 2022 UTC tog: ensure stdin is a tty This guards against {mis,ab}use such as `tog < /dev/null`. ok plus fix from op@ commit - a004b24a97cfaa2be171871f42cdc15e24fa8682 commit + cacf16907d60b1450a87868913052cb6dd375b24 blob - bfc4692ed93bfd9f74dea2238d3700924e4d9a4f blob + 32d532502b365f2075bf7052eb2122effff930d6 --- tog/tog.c +++ tog/tog.c @@ -8483,6 +8483,9 @@ main(int argc, char *argv[]) }; char *diff_algo_str = NULL; + if (!isatty(STDIN_FILENO)) + errx(1, "standard input is not a tty"); + setlocale(LC_CTYPE, ""); while ((ch = getopt_long(argc, argv, "+hV", longopts, NULL)) != -1) {