Add usage() to failure to read stdin/out.

This commit is contained in:
Con Kolivas 2011-02-21 13:29:45 +11:00
parent b06287cce5
commit 5c80a0957d

2
main.c
View file

@ -912,10 +912,12 @@ int main(int argc, char *argv[])
if (!FORCE_REPLACE) {
if (STDIN && isatty(fileno((FILE *)stdin))) {
print_err("Will not read stdin from a terminal. Use -f to override.\n");
usage();
exit (1);
}
if (STDIN && isatty(fileno((FILE *)stdout))) {
print_err("Will not write stdout to a terminal. Use -f to override.\n");
usage();
exit (1);
}
}