diff options
author | Ron Yorston <rmy@pobox.com> | 2018-04-05 20:31:13 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2018-04-05 20:31:13 +0100 |
commit | f7c592f6d832602a628008d598a3aa130d89de4d (patch) | |
tree | 5b771c3f51bfb51e52f3736f89f7b4b195e13f82 /miscutils | |
parent | 3f18c23c67ea8614f1901265d100d3e49bc7491e (diff) | |
download | busybox-w32-f7c592f6d832602a628008d598a3aa130d89de4d.tar.gz busybox-w32-f7c592f6d832602a628008d598a3aa130d89de4d.tar.bz2 busybox-w32-f7c592f6d832602a628008d598a3aa130d89de4d.zip |
win32: exclude termios code
The code to manipulate terminal settings serves no purpose in WIN32.
Use conditional compilation to exclude much of it.
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/less.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 { | |||
238 | smallint winsize_err; | 238 | smallint winsize_err; |
239 | #endif | 239 | #endif |
240 | smallint terminated; | 240 | smallint terminated; |
241 | #if !ENABLE_PLATFORM_MINGW32 | ||
241 | struct termios term_orig, term_less; | 242 | struct termios term_orig, term_less; |
243 | #endif | ||
242 | char kbd_input[KEYCODE_BUFFER_SIZE]; | 244 | char kbd_input[KEYCODE_BUFFER_SIZE]; |
243 | }; | 245 | }; |
244 | #define G (*ptr_to_globals) | 246 | #define G (*ptr_to_globals) |
@@ -300,7 +302,9 @@ struct globals { | |||
300 | static void set_tty_cooked(void) | 302 | static void set_tty_cooked(void) |
301 | { | 303 | { |
302 | fflush_all(); | 304 | fflush_all(); |
305 | #if !ENABLE_PLATFORM_MINGW32 | ||
303 | tcsetattr(kbd_fd, TCSANOW, &term_orig); | 306 | tcsetattr(kbd_fd, TCSANOW, &term_orig); |
307 | #endif | ||
304 | } | 308 | } |
305 | 309 | ||
306 | /* Move the cursor to a position (x,y), where (0,0) is the | 310 | /* Move the cursor to a position (x,y), where (0,0) is the |
@@ -1966,7 +1970,9 @@ int less_main(int argc, char **argv) | |||
1966 | kbd_fd = tty_fd = 0; | 1970 | kbd_fd = tty_fd = 0; |
1967 | #endif | 1971 | #endif |
1968 | 1972 | ||
1973 | #if !ENABLE_PLATFORM_MINGW32 | ||
1969 | get_termios_and_make_raw(tty_fd, &term_less, &term_orig, TERMIOS_RAW_CRNL); | 1974 | get_termios_and_make_raw(tty_fd, &term_less, &term_orig, TERMIOS_RAW_CRNL); |
1975 | #endif | ||
1970 | 1976 | ||
1971 | IF_FEATURE_LESS_ASK_TERMINAL(G.winsize_err =) get_terminal_width_height(tty_fd, &width, &max_displayed_line); | 1977 | IF_FEATURE_LESS_ASK_TERMINAL(G.winsize_err =) get_terminal_width_height(tty_fd, &width, &max_displayed_line); |
1972 | /* 20: two tabstops + 4 */ | 1978 | /* 20: two tabstops + 4 */ |