projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
184b266
)
libbb: fix bb_ask() to flush input before prompt, not after. Closes 7190
author
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 1 Jul 2014 11:20:22 +0000
(13:20 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 1 Jul 2014 11:20:22 +0000
(13:20 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/bb_askpass.c
patch
|
blob
|
history
diff --git
a/libbb/bb_askpass.c
b/libbb/bb_askpass.c
index 77c1bcd9566237f3304fad7a8963cb12f3ac3677..1927ba9e95102b8523822114f89c393d023ebb4d 100644
(file)
--- a/
libbb/bb_askpass.c
+++ b/
libbb/bb_askpass.c
@@
-30,9
+30,12
@@
char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt)
struct sigaction sa, oldsa;
struct termios tio, oldtio;
+ tcflush(fd, TCIFLUSH);
+ /* Was buggy: was printing prompt *before* flushing input,
+ * which was upsetting "expect" based scripts of some users.
+ */
fputs(prompt, stdout);
fflush_all();
- tcflush(fd, TCIFLUSH);
tcgetattr(fd, &oldtio);
tio = oldtio;