X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;ds=sidebyside;f=progs%2Ftset.c;h=d660d84d0f21787787eb24dccaee93a0d1e25bf9;hb=690589d8f19e38925db061296d4f704e4a965bb2;hp=f21cb6d731f330948a9703b0c1c543ac33731ec7;hpb=f06e14af5e11df95d6542964bf1b349d2843bb11;p=ncurses.git diff --git a/progs/tset.c b/progs/tset.c index f21cb6d7..d660d84d 100644 --- a/progs/tset.c +++ b/progs/tset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 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 * @@ -88,6 +88,7 @@ #include #include #include +#include #if HAVE_GETTTYNAM && HAVE_TTYENT_H #include @@ -96,7 +97,7 @@ char *ttyname(int fd); #endif -MODULE_ID("$Id: tset.c,v 1.113 2016/10/22 23:34:47 tom Exp $") +MODULE_ID("$Id: tset.c,v 1.116 2017/01/07 22:48:20 tom Exp $") #ifndef environ extern char **environ; @@ -627,7 +628,7 @@ get_termcap_entry(int fd, char *userarg) ttype = askuser(0); } /* Find the terminfo entry. If it doesn't exist, ask the user. */ - while (setupterm((NCURSES_CONST char *) ttype, STDOUT_FILENO, &errret) + while (setupterm((NCURSES_CONST char *) ttype, fd, &errret) != OK) { if (errret == 0) { (void) fprintf(stderr, "%s: unknown terminal type %s\n", @@ -834,9 +835,9 @@ main(int argc, char **argv) if (same_program(_nc_progname, PROG_RESET)) { reset_start(stderr, TRUE, FALSE); - reset_tty_settings(&mode); + reset_tty_settings(my_fd, &mode); } else { - reset_start(stderr, FALSE, FALSE); + reset_start(stderr, FALSE, TRUE); } ttype = get_termcap_entry(my_fd, *argv); @@ -852,7 +853,7 @@ main(int argc, char **argv) set_conversions(&mode); if (!noinit) { - if (send_init_strings(&oldmode)) { + if (send_init_strings(my_fd, &oldmode)) { (void) putc('\r', stderr); (void) fflush(stderr); (void) napms(1000); /* Settle the terminal. */