aboutsummaryrefslogtreecommitdiff
path: root/util-linux/more.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/more.c')
-rw-r--r--util-linux/more.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/util-linux/more.c b/util-linux/more.c
index 07275131e..84ce37bc7 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -62,6 +62,7 @@ static void tcsetattr_tty_TCSANOW(struct termios *settings)
62 tcsetattr(G.tty_fileno, TCSANOW, settings); 62 tcsetattr(G.tty_fileno, TCSANOW, settings);
63} 63}
64 64
65#if !ENABLE_PLATFORM_MINGW32
65static void gotsig(int sig UNUSED_PARAM) 66static void gotsig(int sig UNUSED_PARAM)
66{ 67{
67 /* bb_putchar_stderr doesn't use stdio buffering, 68 /* bb_putchar_stderr doesn't use stdio buffering,
@@ -70,6 +71,7 @@ static void gotsig(int sig UNUSED_PARAM)
70 tcsetattr_tty_TCSANOW(&G.initial_settings); 71 tcsetattr_tty_TCSANOW(&G.initial_settings);
71 _exit(EXIT_FAILURE); 72 _exit(EXIT_FAILURE);
72} 73}
74#endif
73 75
74#define CONVERTED_TAB_SIZE 8 76#define CONVERTED_TAB_SIZE 8
75 77
@@ -159,12 +161,13 @@ int more_main(int argc UNUSED_PARAM, char **argv)
159 * to get input from the user. 161 * to get input from the user.
160 */ 162 */
161 for (;;) { 163 for (;;) {
162#if !ENABLE_PLATFORM_MINGW32
163 fflush_all(); 164 fflush_all();
164 input = getc(tty); 165#if ENABLE_PLATFORM_MINGW32
165#else 166 if (!(terminal_mode(FALSE) & VT_INPUT))
166 input = _getch(); 167 input = _getch();
168 else
167#endif 169#endif
170 input = getc(tty);
168 input = tolower(input); 171 input = tolower(input);
169 /* Erase the last message */ 172 /* Erase the last message */
170 printf("\r%*s\r", len, ""); 173 printf("\r%*s\r", len, "");