No args default w/ tty stdout, not tty stdin #220

This commit is contained in:
Nicolas Williams committed 2014-06-16 22:34:50 -05:00
1 parent ea0ffe24f8
commit ea63d5d3c2
2 files changed
+15

No files matched your search

+12
View File
@@ -237,6 +237,18 @@ int main(int argc, char* argv[]) {
die();
}
}
#if (!defined(WIN32) && defined(HAVE_ISATTY)) || defined(HAVE__ISATTY)
#if defined(HAVE__ISATTY) && defined(isatty)
#undef isatty
#define isatty _isatty
#endif
if (!program && isatty(STDOUT_FILENO) && !isatty(STDIN_FILENO))
program = ".";
#endif
if (!program) usage();
if (ninput_files == 0) current_input = stdin;