diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-03-19 05:28:55 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-03-19 05:28:55 +0000 |
commit | c7c634bd88c57d910c6089de7f0091ca4e3d1843 (patch) | |
tree | df2b1c18c27729603880dd797ee6bd51d192d9cd /shell/lash.c | |
parent | 6c41c448982827ef5bfac9bac14bc9e509f45bc4 (diff) | |
download | busybox-w32-c7c634bd88c57d910c6089de7f0091ca4e3d1843.tar.gz busybox-w32-c7c634bd88c57d910c6089de7f0091ca4e3d1843.tar.bz2 busybox-w32-c7c634bd88c57d910c6089de7f0091ca4e3d1843.zip |
Some more stuff.
-Erik
Diffstat (limited to 'shell/lash.c')
-rw-r--r-- | shell/lash.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/shell/lash.c b/shell/lash.c index 068159697..8c1503ff4 100644 --- a/shell/lash.c +++ b/shell/lash.c | |||
@@ -39,10 +39,6 @@ | |||
39 | #include <unistd.h> | 39 | #include <unistd.h> |
40 | 40 | ||
41 | 41 | ||
42 | #ifdef BB_FEATURE_SH_COMMAND_EDITING | ||
43 | #include "cmdedit.h" | ||
44 | #endif | ||
45 | |||
46 | #define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n" | 42 | #define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n" |
47 | 43 | ||
48 | 44 | ||
@@ -123,8 +119,7 @@ static struct builtInCommand bltins[] = { | |||
123 | {"export", "Set environment variable", "export [VAR=value]", shell_export}, | 119 | {"export", "Set environment variable", "export [VAR=value]", shell_export}, |
124 | {"unset", "Unset environment variable", "unset VAR", shell_unset}, | 120 | {"unset", "Unset environment variable", "unset VAR", shell_unset}, |
125 | 121 | ||
126 | {".", "Source-in and run commands in a file", ". filename", | 122 | {".", "Source-in and run commands in a file", ". filename", shell_source}, |
127 | shell_source}, | ||
128 | {"help", "List shell built-in commands", "help", shell_help}, | 123 | {"help", "List shell built-in commands", "help", shell_help}, |
129 | {NULL, NULL, NULL, NULL} | 124 | {NULL, NULL, NULL, NULL} |
130 | }; | 125 | }; |
@@ -396,11 +391,19 @@ static void checkJobs(struct jobSet *jobList) | |||
396 | static int getCommand(FILE * source, char *command) | 391 | static int getCommand(FILE * source, char *command) |
397 | { | 392 | { |
398 | if (source == stdin) { | 393 | if (source == stdin) { |
399 | fprintf(stdout, "BBSHELL %s %s", cwd, prompt); | ||
400 | fflush(stdout); | ||
401 | #ifdef BB_FEATURE_SH_COMMAND_EDITING | 394 | #ifdef BB_FEATURE_SH_COMMAND_EDITING |
402 | cmdedit_read_input(fileno(stdin), fileno(stdout), command); | 395 | int len; |
396 | char *promptStr; | ||
397 | len=fprintf(stdout, "BBSHELL %s %s", cwd, prompt); | ||
398 | fflush(stdout); | ||
399 | promptStr=(char*)malloc(sizeof(char)*(len+1)); | ||
400 | sprintf(promptStr, "BBSHELL %s %s", cwd, prompt); | ||
401 | cmdedit_read_input(promptStr, fileno(stdin), fileno(stdout), command); | ||
402 | free( promptStr); | ||
403 | return 0; | 403 | return 0; |
404 | #else | ||
405 | fprintf(stdout, "%s %s", cwd, prompt); | ||
406 | fflush(stdout); | ||
404 | #endif | 407 | #endif |
405 | } | 408 | } |
406 | 409 | ||