aboutsummaryrefslogtreecommitdiff
path: root/miscutils/less.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/less.c')
-rw-r--r--miscutils/less.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/miscutils/less.c b/miscutils/less.c
index d524b6c87..c6c158a51 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -1824,15 +1824,9 @@ int less_main(int argc, char **argv)
1824 G.kbd_fd_orig_flags = ndelay_on(tty_fd); 1824 G.kbd_fd_orig_flags = ndelay_on(tty_fd);
1825 kbd_fd = tty_fd; /* save in a global */ 1825 kbd_fd = tty_fd; /* save in a global */
1826 1826
1827 tcgetattr(kbd_fd, &term_orig); 1827 get_termios_and_make_raw(tty_fd, &term_less, &term_orig, TERMIOS_RAW_CRNL);
1828 term_less = term_orig; 1828
1829 term_less.c_lflag &= ~(ICANON | ECHO); 1829 IF_FEATURE_LESS_ASK_TERMINAL(G.winsize_err =) get_terminal_width_height(tty_fd, &width, &max_displayed_line);
1830 term_less.c_iflag &= ~(IXON | ICRNL);
1831 /*term_less.c_oflag &= ~ONLCR;*/
1832 term_less.c_cc[VMIN] = 1;
1833 term_less.c_cc[VTIME] = 0;
1834
1835 IF_FEATURE_LESS_ASK_TERMINAL(G.winsize_err =) get_terminal_width_height(kbd_fd, &width, &max_displayed_line);
1836 /* 20: two tabstops + 4 */ 1830 /* 20: two tabstops + 4 */
1837 if (width < 20 || max_displayed_line < 3) 1831 if (width < 20 || max_displayed_line < 3)
1838 return bb_cat(argv); 1832 return bb_cat(argv);