diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-12-18 20:25:50 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-12-18 20:25:50 +0000 |
commit | 45db1e02d6e5d8d6fa603d48c2e3669f14dd9a36 (patch) | |
tree | e859688d5a9399aad84f23a59dfb48533f1d7fcb /shell/cmdedit.c | |
parent | c86ef1b2547856c114bdc16ed374585ea0a570e9 (diff) | |
download | busybox-w32-45db1e02d6e5d8d6fa603d48c2e3669f14dd9a36.tar.gz busybox-w32-45db1e02d6e5d8d6fa603d48c2e3669f14dd9a36.tar.bz2 busybox-w32-45db1e02d6e5d8d6fa603d48c2e3669f14dd9a36.zip |
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
git-svn-id: svn://busybox.net/trunk/busybox@1467 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell/cmdedit.c')
-rw-r--r-- | shell/cmdedit.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c index c32330bfd..0c9bda760 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c | |||
@@ -85,6 +85,12 @@ static int cmdedit_scroll = 27; /* width of EOL scrolling region */ | |||
85 | static int history_counter = 0; /* Number of commands in history list */ | 85 | static int history_counter = 0; /* Number of commands in history list */ |
86 | static int reset_term = 0; /* Set to true if the terminal needs to be reset upon exit */ | 86 | static int reset_term = 0; /* Set to true if the terminal needs to be reset upon exit */ |
87 | static int exithandler_set = 0; /* Set to true when atexit() has been called */ | 87 | static int exithandler_set = 0; /* Set to true when atexit() has been called */ |
88 | |||
89 | |||
90 | /* Link into lash to reset context to 0 | ||
91 | * on ^C and such */ | ||
92 | extern unsigned int shell_context; | ||
93 | |||
88 | 94 | ||
89 | struct history { | 95 | struct history { |
90 | char *s; | 96 | char *s; |
@@ -466,20 +472,24 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ]) | |||
466 | input_backward(outputFd, &cursor); | 472 | input_backward(outputFd, &cursor); |
467 | break; | 473 | break; |
468 | case 3: | 474 | case 3: |
469 | /* Control-c -- leave the current line, | 475 | /* Control-c -- stop gathering input */ |
470 | * and start over on the next line */ | 476 | |
477 | /* Link into lash to reset context to 0 on ^C and such */ | ||
478 | shell_context = 0; | ||
471 | 479 | ||
472 | /* Go to the next line */ | 480 | /* Go to the next line */ |
473 | xwrite(outputFd, "\n", 1); | 481 | xwrite(outputFd, "\n", 1); |
474 | 482 | ||
483 | #if 0 | ||
475 | /* Rewrite the prompt */ | 484 | /* Rewrite the prompt */ |
476 | xwrite(outputFd, prompt, strlen(prompt)); | 485 | xwrite(outputFd, prompt, strlen(prompt)); |
477 | 486 | ||
478 | /* Reset the command string */ | 487 | /* Reset the command string */ |
479 | memset(command, 0, BUFSIZ); | 488 | memset(command, 0, BUFSIZ); |
480 | len = cursor = 0; | 489 | len = cursor = 0; |
490 | #endif | ||
491 | return; | ||
481 | 492 | ||
482 | break; | ||
483 | case 4: | 493 | case 4: |
484 | /* Control-d -- Delete one character, or exit | 494 | /* Control-d -- Delete one character, or exit |
485 | * if the len=0 and no chars to delete */ | 495 | * if the len=0 and no chars to delete */ |