From f7c592f6d832602a628008d598a3aa130d89de4d Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 5 Apr 2018 20:31:13 +0100 Subject: win32: exclude termios code The code to manipulate terminal settings serves no purpose in WIN32. Use conditional compilation to exclude much of it. --- miscutils/less.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'miscutils') diff --git a/miscutils/less.c b/miscutils/less.c index e4885db77..9c75ae7ac 100644 --- a/miscutils/less.c +++ b/miscutils/less.c @@ -238,7 +238,9 @@ struct globals { smallint winsize_err; #endif smallint terminated; +#if !ENABLE_PLATFORM_MINGW32 struct termios term_orig, term_less; +#endif char kbd_input[KEYCODE_BUFFER_SIZE]; }; #define G (*ptr_to_globals) @@ -300,7 +302,9 @@ struct globals { static void set_tty_cooked(void) { fflush_all(); +#if !ENABLE_PLATFORM_MINGW32 tcsetattr(kbd_fd, TCSANOW, &term_orig); +#endif } /* Move the cursor to a position (x,y), where (0,0) is the @@ -1966,7 +1970,9 @@ int less_main(int argc, char **argv) kbd_fd = tty_fd = 0; #endif +#if !ENABLE_PLATFORM_MINGW32 get_termios_and_make_raw(tty_fd, &term_less, &term_orig, TERMIOS_RAW_CRNL); +#endif IF_FEATURE_LESS_ASK_TERMINAL(G.winsize_err =) get_terminal_width_height(tty_fd, &width, &max_displayed_line); /* 20: two tabstops + 4 */ -- cgit v1.2.3-55-g6feb