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
This commit is contained in:
parent
1fa1adea2a
commit
86349776d0
16
cmdedit.c
16
cmdedit.c
@ -86,6 +86,12 @@ 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;
|
||||
struct history *p;
|
||||
@ -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 */
|
||||
|
@ -86,6 +86,12 @@ 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;
|
||||
struct history *p;
|
||||
@ -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 */
|
||||
|
1054
shell/lash.c
1054
shell/lash.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user