summaryrefslogtreecommitdiff
path: root/cmdedit.c
diff options
context:
space:
mode:
authorEric Andersen2000-12-18 20:25:50 +0000
committerEric Andersen2000-12-18 20:25:50 +0000
commit86349776d0006440c0fefab7dc05a38329bcc466 (patch)
treee859688d5a9399aad84f23a59dfb48533f1d7fcb /cmdedit.c
parent1fa1adea2ae16d4f4c82d7466905dce4c6edd5f5 (diff)
downloadbusybox-86349776d0006440c0fefab7dc05a38329bcc466.zip
busybox-86349776d0006440c0fefab7dc05a38329bcc466.tar.gz
Ok, this is a pretty major update to sh.c. I renamed all the variables and
function names to conform with the style guide. I also did a lot of work on the if-then-alse-fi logic and added prototype (i.e. it segfaults when enabled) line continuation support. Furthermore, this patch includes Larry Doolittle's work on restructuring some of the data structures that represent the job and child_program, allowing several simplifications and fixing several bugs. -Erik
Diffstat (limited to 'cmdedit.c')
-rw-r--r--cmdedit.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/cmdedit.c b/cmdedit.c
index c32330b..0c9bda7 100644
--- a/cmdedit.c
+++ b/cmdedit.c
@@ -85,6 +85,12 @@ static int cmdedit_scroll = 27; /* width of EOL scrolling region */
static int history_counter = 0; /* Number of commands in history list */
static int reset_term = 0; /* Set to true if the terminal needs to be reset upon exit */
static int exithandler_set = 0; /* Set to true when atexit() has been called */
+
+
+/* Link into lash to reset context to 0
+ * on ^C and such */
+extern unsigned int shell_context;
+
struct history {
char *s;
@@ -466,20 +472,24 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ])
input_backward(outputFd, &cursor);
break;
case 3:
- /* Control-c -- leave the current line,
- * and start over on the next line */
+ /* Control-c -- stop gathering input */
+
+ /* Link into lash to reset context to 0 on ^C and such */
+ shell_context = 0;
/* Go to the next line */
xwrite(outputFd, "\n", 1);
+#if 0
/* Rewrite the prompt */
xwrite(outputFd, prompt, strlen(prompt));
/* Reset the command string */
memset(command, 0, BUFSIZ);
len = cursor = 0;
+#endif
+ return;
- break;
case 4:
/* Control-d -- Delete one character, or exit
* if the len=0 and no chars to delete */