summaryrefslogtreecommitdiff
path: root/cmdedit.c
diff options
context:
space:
mode:
authorEric Andersen2001-08-02 05:02:46 +0000
committerEric Andersen2001-08-02 05:02:46 +0000
commit34506361697643277042fc8d7294bc17a27d4e28 (patch)
treebf2c45a12020be4e0a37547abb50c40c0074e8ec /cmdedit.c
parent2d91deba45d5a284614e06cc55e2be03599ca26d (diff)
downloadbusybox-34506361697643277042fc8d7294bc17a27d4e28.zip
busybox-34506361697643277042fc8d7294bc17a27d4e28.tar.gz
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 'cmdedit.c')
-rw-r--r--cmdedit.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/cmdedit.c b/cmdedit.c
index 3b47504..2ec8154 100644
--- a/cmdedit.c
+++ b/cmdedit.c
@@ -1167,25 +1167,21 @@ int cmdedit_read_input(char *prompt, char command[BUFSIZ])
len = 0;
command_ps = command;
- if (new_settings.c_cc[VERASE] == 0) { /* first call */
-
- getTermSettings(0, (void *) &initial_settings);
- memcpy(&new_settings, &initial_settings, sizeof(struct termios));
- new_settings.c_lflag &= ~ICANON; /* unbuffered input */
- /* Turn off echoing and CTRL-C, so we can trap it */
- new_settings.c_lflag &= ~(ECHO | ECHONL | ISIG);
+ getTermSettings(0, (void *) &initial_settings);
+ memcpy(&new_settings, &initial_settings, sizeof(struct termios));
+ new_settings.c_lflag &= ~ICANON; /* unbuffered input */
+ /* Turn off echoing and CTRL-C, so we can trap it */
+ new_settings.c_lflag &= ~(ECHO | ECHONL | ISIG);
#ifndef linux
- /* Hmm, in linux c_cc[] not parsed if set ~ICANON */
- new_settings.c_cc[VMIN] = 1;
- new_settings.c_cc[VTIME] = 0;
- /* Turn off CTRL-C, so we can trap it */
+ /* Hmm, in linux c_cc[] not parsed if set ~ICANON */
+ new_settings.c_cc[VMIN] = 1;
+ new_settings.c_cc[VTIME] = 0;
+ /* Turn off CTRL-C, so we can trap it */
# ifndef _POSIX_VDISABLE
# define _POSIX_VDISABLE '\0'
# endif
- new_settings.c_cc[VINTR] = _POSIX_VDISABLE;
+ new_settings.c_cc[VINTR] = _POSIX_VDISABLE;
#endif
- }
-
command[0] = 0;
setTermSettings(0, (void *) &new_settings);