From: Francois Fleuret Date: Tue, 19 Jan 2010 21:12:21 +0000 (+0100) Subject: Changed ttyname() to isatty() + cosmetics. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=3852f552e20357d13fe51c40c0ca093c003c1e21;p=selector.git Changed ttyname() to isatty() + cosmetics. --- diff --git a/selector.c b/selector.c index f6c7b12..e9807c9 100644 --- a/selector.c +++ b/selector.c @@ -745,7 +745,7 @@ int main(int argc, char **argv) { int nb_lines; struct hash_table_t *hash_table; - if(!ttyname(STDIN_FILENO)) { + if(!isatty(STDIN_FILENO)) { fprintf(stderr, "Selector: The standard input is not a tty.\n"); exit(1); } @@ -763,8 +763,8 @@ int main(int argc, char **argv) { i = 1; while(!error && !show_help && - i < argc && argv[i][0] == '-' && - !rest_are_files) { + i < argc && + argv[i][0] == '-' && !rest_are_files) { if(strcmp(argv[i], "-o") == 0) { check_opt(argc, argv, i, 1, "");