diff options
author | Denis Vlasenko | 2008-03-21 08:50:06 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-03-21 08:50:06 +0000 |
commit | 9924ce1cdcb6e4ab9635d6370ff7db6219c56094 (patch) | |
tree | 519c1bd5ff03997c9b11ceb7972da7467e44ea48 /libbb | |
parent | 80297d5f0cbe8a3de497804dcbb1a89e6f9c1562 (diff) | |
download | busybox-9924ce1cdcb6e4ab9635d6370ff7db6219c56094.zip busybox-9924ce1cdcb6e4ab9635d6370ff7db6219c56094.tar.gz |
apply four post-1.8.2 patches; bump to 1.8.31_8_3
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/lineedit.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index f65e852..4253054 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -1211,7 +1211,7 @@ static void parse_prompt(const char *prmt_ptr) #endif #define setTermSettings(fd, argp) tcsetattr(fd, TCSANOW, argp) -#define getTermSettings(fd, argp) tcgetattr(fd, argp); +#define getTermSettings(fd, argp) tcgetattr(fd, argp) static sighandler_t previous_SIGWINCH_handler; @@ -1270,9 +1270,10 @@ int read_line_input(const char *prompt, char *command, int maxsize, line_input_t smalluint prevc; #endif - getTermSettings(0, (void *) &initial_settings); - /* Happens when e.g. stty -echo was run before */ - if (!(initial_settings.c_lflag & ECHO)) { + if (getTermSettings(0, (void *) &initial_settings) < 0 + /* Happens when e.g. stty -echo was run before */ + || !(initial_settings.c_lflag & ECHO) + ) { parse_prompt(prompt); fflush(stdout); fgets(command, maxsize, stdin); |