aboutsummaryrefslogtreecommitdiff
path: root/libbb/lineedit.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r--libbb/lineedit.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 0f7ab8c94..a9972576e 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -373,7 +373,7 @@ static void input_backward(unsigned num)
373static void put_prompt(void) 373static void put_prompt(void)
374{ 374{
375 out1str(cmdedit_prompt); 375 out1str(cmdedit_prompt);
376 fflush(NULL); 376 fflush_all();
377#if ENABLE_FEATURE_EDITING_ASK_TERMINAL 377#if ENABLE_FEATURE_EDITING_ASK_TERMINAL
378 { 378 {
379 /* Ask terminal where is the cursor now. 379 /* Ask terminal where is the cursor now.
@@ -411,7 +411,7 @@ static void put_prompt(void)
411 if (safe_poll(&pfd, 1, 0) == 0) { 411 if (safe_poll(&pfd, 1, 0) == 0) {
412 S.sent_ESC_br6n = 1; 412 S.sent_ESC_br6n = 1;
413 out1str("\033" "[6n"); 413 out1str("\033" "[6n");
414 fflush(NULL); /* make terminal see it ASAP! */ 414 fflush_all(); /* make terminal see it ASAP! */
415 } 415 }
416 } 416 }
417#endif 417#endif
@@ -1636,7 +1636,7 @@ static void cmdedit_setwidth(unsigned w, int redraw_flg)
1636 int new_y = (cursor + cmdedit_prmt_len) / w; 1636 int new_y = (cursor + cmdedit_prmt_len) / w;
1637 /* redraw */ 1637 /* redraw */
1638 redraw((new_y >= cmdedit_y ? new_y : cmdedit_y), command_len - cursor); 1638 redraw((new_y >= cmdedit_y ? new_y : cmdedit_y), command_len - cursor);
1639 fflush(NULL); 1639 fflush_all();
1640 } 1640 }
1641} 1641}
1642 1642
@@ -1748,7 +1748,7 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
1748 ) { 1748 ) {
1749 /* Happens when e.g. stty -echo was run before */ 1749 /* Happens when e.g. stty -echo was run before */
1750 parse_and_put_prompt(prompt); 1750 parse_and_put_prompt(prompt);
1751 /* fflush(stdout); - done by parse_and_put_prompt */ 1751 /* fflush_all(); - done by parse_and_put_prompt */
1752 if (fgets(command, maxsize, stdin) == NULL) 1752 if (fgets(command, maxsize, stdin) == NULL)
1753 len = -1; /* EOF or error */ 1753 len = -1; /* EOF or error */
1754 else 1754 else
@@ -1841,7 +1841,7 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
1841 }; 1841 };
1842 int32_t ic, ic_raw; 1842 int32_t ic, ic_raw;
1843 1843
1844 fflush(NULL); 1844 fflush_all();
1845 ic = ic_raw = lineedit_read_key(read_key_buffer); 1845 ic = ic_raw = lineedit_read_key(read_key_buffer);
1846 1846
1847#if ENABLE_FEATURE_EDITING_VI 1847#if ENABLE_FEATURE_EDITING_VI
@@ -2245,7 +2245,7 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
2245 tcsetattr_stdin_TCSANOW(&initial_settings); 2245 tcsetattr_stdin_TCSANOW(&initial_settings);
2246 /* restore SIGWINCH handler */ 2246 /* restore SIGWINCH handler */
2247 signal(SIGWINCH, previous_SIGWINCH_handler); 2247 signal(SIGWINCH, previous_SIGWINCH_handler);
2248 fflush(NULL); 2248 fflush_all();
2249 2249
2250 len = command_len; 2250 len = command_len;
2251 DEINIT_S(); 2251 DEINIT_S();
@@ -2259,7 +2259,7 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
2259int FAST_FUNC read_line_input(const char* prompt, char* command, int maxsize) 2259int FAST_FUNC read_line_input(const char* prompt, char* command, int maxsize)
2260{ 2260{
2261 fputs(prompt, stdout); 2261 fputs(prompt, stdout);
2262 fflush(NULL); 2262 fflush_all();
2263 fgets(command, maxsize, stdin); 2263 fgets(command, maxsize, stdin);
2264 return strlen(command); 2264 return strlen(command);
2265} 2265}