← Commit list

d32fc647d

Denys Vlasenko
Denys Vlasenko
2014-07-01
SUCCESS Duration: 196s

Subject

libbb: fix bb_ask() to flush input before prompt, not after. Closes 7190

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/bb_askpass.c+4 -1
@@ -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;