X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Ftset.c;h=4d33ca8789c279fb34b544210fc6a39e53dd2981;hp=8fb5be7286e8e5c0d65a148edbbbd344289f0617;hb=2b7c2fd2f9d58719770902ce4d0d0aeb87b284f7;hpb=0485620c03e69b1b58a6b12e5e45c98415fc7575 diff --git a/progs/tset.c b/progs/tset.c index 8fb5be72..4d33ca87 100644 --- a/progs/tset.c +++ b/progs/tset.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * + * Copyright 2020 Thomas E. Dickey * + * Copyright 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 * @@ -97,7 +98,7 @@ char *ttyname(int fd); #endif -MODULE_ID("$Id: tset.c,v 1.118 2017/08/19 13:16:03 tom Exp $") +MODULE_ID("$Id: tset.c,v 1.125 2020/09/05 22:54:47 tom Exp $") #ifndef environ extern char **environ; @@ -132,7 +133,7 @@ exit_error(void) } static void -err(const char *fmt,...) +err(const char *fmt, ...) { va_list ap; va_start(ap, fmt); @@ -226,10 +227,16 @@ static MAP *cur, *maplist; #define DATA(name,value) { { name }, value } typedef struct speeds { - const char string[7]; + const char string[8]; int speed; } SPEEDS; +#if defined(EXP_WIN32_DRIVER) +static const SPEEDS speeds[] = +{ + {"0", 0} +}; +#else static const SPEEDS speeds[] = { DATA("0", B0), @@ -330,6 +337,7 @@ static const SPEEDS speeds[] = #endif }; #undef DATA +#endif static int tbaudrate(char *rate) @@ -760,7 +768,7 @@ main(int argc, char **argv) int terasechar = -1; /* new erase character */ int intrchar = -1; /* new interrupt character */ int tkillchar = -1; /* new kill character */ - int my_fd = -1; + int my_fd; bool opt_c = FALSE; /* set control-chars */ bool opt_w = FALSE; /* set window-size */ TTY mode, oldmode; @@ -834,10 +842,12 @@ main(int argc, char **argv) if (!opt_c && !opt_w) opt_c = opt_w = TRUE; - my_fd = save_tty_settings(&mode); + my_fd = save_tty_settings(&mode, TRUE); oldmode = mode; #ifdef TERMIOS ospeed = (NCURSES_OSPEED) cfgetospeed(&mode); +#elif defined(EXP_WIN32_DRIVER) + ospeed = 0; #else ospeed = (NCURSES_OSPEED) mode.sg_ospeed; #endif