diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-08-02 05:02:46 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-08-02 05:02:46 +0000 |
commit | 34506361697643277042fc8d7294bc17a27d4e28 (patch) | |
tree | bf2c45a12020be4e0a37547abb50c40c0074e8ec /shell/cmdedit.c | |
parent | 2d91deba45d5a284614e06cc55e2be03599ca26d (diff) | |
download | busybox-w32-34506361697643277042fc8d7294bc17a27d4e28.tar.gz busybox-w32-34506361697643277042fc8d7294bc17a27d4e28.tar.bz2 busybox-w32-34506361697643277042fc8d7294bc17a27d4e28.zip |
Latest patch from vodz. Adds a check for divide by zero in the posix
math suport, cleaner math syntax error checking, moves redundant signal
string tables (from kill and ash) into libbb and provides a few
cleanups elsewhere.
Diffstat (limited to 'shell/cmdedit.c')
-rw-r--r-- | shell/cmdedit.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c index 3b4750455..2ec81548d 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c | |||
@@ -1167,25 +1167,21 @@ int cmdedit_read_input(char *prompt, char command[BUFSIZ]) | |||
1167 | len = 0; | 1167 | len = 0; |
1168 | command_ps = command; | 1168 | command_ps = command; |
1169 | 1169 | ||
1170 | if (new_settings.c_cc[VERASE] == 0) { /* first call */ | 1170 | getTermSettings(0, (void *) &initial_settings); |
1171 | 1171 | memcpy(&new_settings, &initial_settings, sizeof(struct termios)); | |
1172 | getTermSettings(0, (void *) &initial_settings); | 1172 | new_settings.c_lflag &= ~ICANON; /* unbuffered input */ |
1173 | memcpy(&new_settings, &initial_settings, sizeof(struct termios)); | 1173 | /* Turn off echoing and CTRL-C, so we can trap it */ |
1174 | new_settings.c_lflag &= ~ICANON; /* unbuffered input */ | 1174 | new_settings.c_lflag &= ~(ECHO | ECHONL | ISIG); |
1175 | /* Turn off echoing and CTRL-C, so we can trap it */ | ||
1176 | new_settings.c_lflag &= ~(ECHO | ECHONL | ISIG); | ||
1177 | #ifndef linux | 1175 | #ifndef linux |
1178 | /* Hmm, in linux c_cc[] not parsed if set ~ICANON */ | 1176 | /* Hmm, in linux c_cc[] not parsed if set ~ICANON */ |
1179 | new_settings.c_cc[VMIN] = 1; | 1177 | new_settings.c_cc[VMIN] = 1; |
1180 | new_settings.c_cc[VTIME] = 0; | 1178 | new_settings.c_cc[VTIME] = 0; |
1181 | /* Turn off CTRL-C, so we can trap it */ | 1179 | /* Turn off CTRL-C, so we can trap it */ |
1182 | # ifndef _POSIX_VDISABLE | 1180 | # ifndef _POSIX_VDISABLE |
1183 | # define _POSIX_VDISABLE '\0' | 1181 | # define _POSIX_VDISABLE '\0' |
1184 | # endif | 1182 | # endif |
1185 | new_settings.c_cc[VINTR] = _POSIX_VDISABLE; | 1183 | new_settings.c_cc[VINTR] = _POSIX_VDISABLE; |
1186 | #endif | 1184 | #endif |
1187 | } | ||
1188 | |||
1189 | command[0] = 0; | 1185 | command[0] = 0; |
1190 | 1186 | ||
1191 | setTermSettings(0, (void *) &new_settings); | 1187 | setTermSettings(0, (void *) &new_settings); |