diff options
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index d6040f47e..fb4028219 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -9523,6 +9523,11 @@ evalpipe(union node *n, int flags) | |||
9523 | return status; | 9523 | return status; |
9524 | } | 9524 | } |
9525 | 9525 | ||
9526 | /* setinteractive needs this forward reference */ | ||
9527 | #if EDITING_HAS_get_exe_name | ||
9528 | static const char *get_builtin_name(int i) FAST_FUNC; | ||
9529 | #endif | ||
9530 | |||
9526 | /* | 9531 | /* |
9527 | * Controls whether the shell is interactive or not. | 9532 | * Controls whether the shell is interactive or not. |
9528 | */ | 9533 | */ |
@@ -9554,8 +9559,12 @@ setinteractive(int on) | |||
9554 | } | 9559 | } |
9555 | #endif | 9560 | #endif |
9556 | #if ENABLE_FEATURE_EDITING | 9561 | #if ENABLE_FEATURE_EDITING |
9557 | if (!line_input_state) | 9562 | if (!line_input_state) { |
9558 | line_input_state = new_line_input_t(FOR_SHELL | WITH_PATH_LOOKUP); | 9563 | line_input_state = new_line_input_t(FOR_SHELL | WITH_PATH_LOOKUP); |
9564 | # if EDITING_HAS_get_exe_name | ||
9565 | line_input_state->get_exe_name = get_builtin_name; | ||
9566 | # endif | ||
9567 | } | ||
9559 | #endif | 9568 | #endif |
9560 | } | 9569 | } |
9561 | } | 9570 | } |
@@ -10023,6 +10032,14 @@ find_builtin(const char *name) | |||
10023 | return bp; | 10032 | return bp; |
10024 | } | 10033 | } |
10025 | 10034 | ||
10035 | #if EDITING_HAS_get_exe_name | ||
10036 | static const char * FAST_FUNC | ||
10037 | get_builtin_name(int i) | ||
10038 | { | ||
10039 | return /*i >= 0 &&*/ i < ARRAY_SIZE(builtintab) ? builtintab[i].name + 1 : NULL; | ||
10040 | } | ||
10041 | #endif | ||
10042 | |||
10026 | /* | 10043 | /* |
10027 | * Execute a simple command. | 10044 | * Execute a simple command. |
10028 | */ | 10045 | */ |