diff options
Diffstat (limited to 'util-linux/more.c')
-rw-r--r-- | util-linux/more.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/util-linux/more.c b/util-linux/more.c index d7b7ce22f..04b29de17 100644 --- a/util-linux/more.c +++ b/util-linux/more.c | |||
@@ -67,6 +67,7 @@ extern int more_main(int argc, char **argv) | |||
67 | int please_display_more_prompt = -1; | 67 | int please_display_more_prompt = -1; |
68 | struct stat st; | 68 | struct stat st; |
69 | FILE *file; | 69 | FILE *file; |
70 | FILE *in_file = stdin; | ||
70 | int len, page_height; | 71 | int len, page_height; |
71 | 72 | ||
72 | argc--; | 73 | argc--; |
@@ -78,6 +79,7 @@ extern int more_main(int argc, char **argv) | |||
78 | cin = fopen(CURRENT_TTY, "r"); | 79 | cin = fopen(CURRENT_TTY, "r"); |
79 | if (!cin) | 80 | if (!cin) |
80 | cin = bb_xfopen(CONSOLE_DEV, "r"); | 81 | cin = bb_xfopen(CONSOLE_DEV, "r"); |
82 | in_file = cin; | ||
81 | please_display_more_prompt = 0; | 83 | please_display_more_prompt = 0; |
82 | #ifdef CONFIG_FEATURE_USE_TERMIOS | 84 | #ifdef CONFIG_FEATURE_USE_TERMIOS |
83 | getTermSettings(fileno(cin), &initial_settings); | 85 | getTermSettings(fileno(cin), &initial_settings); |
@@ -108,7 +110,7 @@ extern int more_main(int argc, char **argv) | |||
108 | if(please_display_more_prompt>0) | 110 | if(please_display_more_prompt>0) |
109 | please_display_more_prompt = 0; | 111 | please_display_more_prompt = 0; |
110 | 112 | ||
111 | get_terminal_width_height(0, &terminal_width, &terminal_height); | 113 | get_terminal_width_height(fileno(in_file), &terminal_width, &terminal_height); |
112 | if (terminal_height > 4) | 114 | if (terminal_height > 4) |
113 | terminal_height -= 2; | 115 | terminal_height -= 2; |
114 | if (terminal_width > 0) | 116 | if (terminal_width > 0) |