diff options
author | Ron Yorston <rmy@pobox.com> | 2012-03-23 12:12:03 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2012-03-23 12:12:03 +0000 |
commit | b0f54743e36af163ae2530c381c485bb29df13dc (patch) | |
tree | cda4cfeaae6e47fe4f14c1b566092be4da9affc4 /libbb/lineedit.c | |
parent | 40514a0309939f2446f0d4ed9600cad5de396e7f (diff) | |
parent | ba88826c66411affc1da3614742b454654f7298a (diff) | |
download | busybox-w32-b0f54743e36af163ae2530c381c485bb29df13dc.tar.gz busybox-w32-b0f54743e36af163ae2530c381c485bb29df13dc.tar.bz2 busybox-w32-b0f54743e36af163ae2530c381c485bb29df13dc.zip |
Merge branch 'busybox' into merge
Conflicts:
Makefile.flags
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r-- | libbb/lineedit.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index c89c829ed..78244c395 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -2221,14 +2221,17 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman | |||
2221 | #define command command_must_not_be_used | 2221 | #define command command_must_not_be_used |
2222 | 2222 | ||
2223 | new_settings = initial_settings; | 2223 | new_settings = initial_settings; |
2224 | new_settings.c_lflag &= ~ICANON; /* unbuffered input */ | 2224 | /* ~ICANON: unbuffered input (most c_cc[] are disabled, VMIN/VTIME are enabled) */ |
2225 | /* Turn off echoing and CTRL-C, so we can trap it */ | 2225 | /* ~ECHO, ~ECHONL: turn off echoing, including newline echoing */ |
2226 | new_settings.c_lflag &= ~(ECHO | ECHONL | ISIG); | 2226 | /* ~ISIG: turn off INTR (ctrl-C), QUIT, SUSP */ |
2227 | /* Hmm, in linux c_cc[] is not parsed if ICANON is off */ | 2227 | new_settings.c_lflag &= ~(ICANON | ECHO | ECHONL | ISIG); |
2228 | /* reads would block only if < 1 char is available */ | ||
2228 | new_settings.c_cc[VMIN] = 1; | 2229 | new_settings.c_cc[VMIN] = 1; |
2230 | /* no timeout (reads block forever) */ | ||
2229 | new_settings.c_cc[VTIME] = 0; | 2231 | new_settings.c_cc[VTIME] = 0; |
2230 | /* Turn off CTRL-C, so we can trap it */ | 2232 | /* Should be not needed if ISIG is off: */ |
2231 | new_settings.c_cc[VINTR] = _POSIX_VDISABLE; | 2233 | /* Turn off CTRL-C */ |
2234 | /* new_settings.c_cc[VINTR] = _POSIX_VDISABLE; */ | ||
2232 | tcsetattr_stdin_TCSANOW(&new_settings); | 2235 | tcsetattr_stdin_TCSANOW(&new_settings); |
2233 | 2236 | ||
2234 | #if ENABLE_USERNAME_OR_HOMEDIR | 2237 | #if ENABLE_USERNAME_OR_HOMEDIR |