aboutsummaryrefslogtreecommitdiff
path: root/shell/lash.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/lash.c')
-rw-r--r--shell/lash.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/shell/lash.c b/shell/lash.c
index b2ccaf0a1..a09a9a9b1 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -23,8 +23,6 @@
23 23
24#include "busybox.h" 24#include "busybox.h"
25#include <getopt.h> 25#include <getopt.h>
26#include "cmdedit.h"
27
28#include <glob.h> 26#include <glob.h>
29#define expand_t glob_t 27#define expand_t glob_t
30 28
@@ -641,6 +639,10 @@ static inline void setup_prompt_string(char **prompt_str)
641#endif 639#endif
642} 640}
643 641
642#if ENABLE_FEATURE_COMMAND_EDITING
643static line_input_t *line_input_state;
644#endif
645
644static int get_command(FILE * source, char *command) 646static int get_command(FILE * source, char *command)
645{ 647{
646 char *prompt_str; 648 char *prompt_str;
@@ -659,14 +661,14 @@ static int get_command(FILE * source, char *command)
659 if (source == stdin) { 661 if (source == stdin) {
660 setup_prompt_string(&prompt_str); 662 setup_prompt_string(&prompt_str);
661 663
662#ifdef CONFIG_FEATURE_COMMAND_EDITING 664#if ENABLE_FEATURE_COMMAND_EDITING
663 /* 665 /*
664 ** enable command line editing only while a command line 666 ** enable command line editing only while a command line
665 ** is actually being read; otherwise, we'll end up bequeathing 667 ** is actually being read; otherwise, we'll end up bequeathing
666 ** atexit() handlers and other unwanted stuff to our 668 ** atexit() handlers and other unwanted stuff to our
667 ** child processes (rob@sysgo.de) 669 ** child processes (rob@sysgo.de)
668 */ 670 */
669 cmdedit_read_input(prompt_str, command); 671 read_line_input(prompt_str, command, BUFSIZ, line_input_state);
670 return 0; 672 return 0;
671#else 673#else
672 fputs(prompt_str, stdout); 674 fputs(prompt_str, stdout);
@@ -1505,6 +1507,10 @@ int lash_main(int argc_l, char **argv_l)
1505 argc = argc_l; 1507 argc = argc_l;
1506 argv = argv_l; 1508 argv = argv_l;
1507 1509
1510#if ENABLE_FEATURE_COMMAND_EDITING
1511 line_input_state = new_line_input_t(FOR_SHELL);
1512#endif
1513
1508 /* These variables need re-initializing when recursing */ 1514 /* These variables need re-initializing when recursing */
1509 last_jobid = 0; 1515 last_jobid = 0;
1510 close_me_list = NULL; 1516 close_me_list = NULL;