X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Ftput.c;h=88e757994fa123a0e4d241b05509e1bca0f13947;hp=76370cbcb74cc8cb3355da93d041d67a17935a03;hb=b60a2772d9f149d8e900c1d5a09a53a56a0837a8;hpb=cd142df6d9934f1bda19f5b968cc666291be5072 diff --git a/progs/tput.c b/progs/tput.c index 76370cbc..88e75799 100644 --- a/progs/tput.c +++ b/progs/tput.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * + * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -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.79 2018/06/30 15:56:01 Nicholas.Marriott Exp $") #define PUTS(s) fputs(s, stdout) @@ -293,7 +293,7 @@ main(int argc, char **argv) term = getenv("TERM"); - while ((c = getopt(argc, argv, "ST:V")) != -1) { + while ((c = getopt(argc, argv, "ST:Vx")) != -1) { switch (c) { case 'S': cmdline = FALSE; @@ -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.