X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Ftput.c;fp=progs%2Ftput.c;h=fd051eb40571935edeedc4af7b92d759a1b0538d;hp=76370cbcb74cc8cb3355da93d041d67a17935a03;hb=7fa7badf32c514211478cf9f79c70f20d435c2f2;hpb=cd142df6d9934f1bda19f5b968cc666291be5072 diff --git a/progs/tput.c b/progs/tput.c index 76370cbc..fd051eb4 100644 --- a/progs/tput.c +++ b/progs/tput.c @@ -50,7 +50,7 @@ #include #include -MODULE_ID("$Id: tput.c,v 1.77 2017/10/07 23:51:01 tom Exp $") +MODULE_ID("$Id: tput.c,v 1.78 2017/10/14 20:46:43 tom Exp $") #define PUTS(s) fputs(s, stdout) @@ -316,7 +316,10 @@ main(int argc, char **argv) } is_alias = (is_clear || is_reset || is_init); - need_tty = (is_reset || is_init); + need_tty = ((is_reset || is_init) || + (optind < argc && + (!strcmp(argv[optind], "reset") || + !strcmp(argv[optind], "init")))); /* * Modify the argument list to omit the options we processed.