diff options
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c index a938cc790..254e0b0ef 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -8220,7 +8220,7 @@ static const struct built_in_command *find_builtin(const char *name) | |||
8220 | } | 8220 | } |
8221 | 8221 | ||
8222 | #if ENABLE_HUSH_JOB && ENABLE_FEATURE_TAB_COMPLETION | 8222 | #if ENABLE_HUSH_JOB && ENABLE_FEATURE_TAB_COMPLETION |
8223 | static const char * FAST_FUNC get_builtin_name(int i) | 8223 | static const char * FAST_FUNC hush_command_name(int i) |
8224 | { | 8224 | { |
8225 | if (/*i >= 0 && */ i < ARRAY_SIZE(bltins1)) { | 8225 | if (/*i >= 0 && */ i < ARRAY_SIZE(bltins1)) { |
8226 | return bltins1[i].b_cmd; | 8226 | return bltins1[i].b_cmd; |
@@ -8229,6 +8229,13 @@ static const char * FAST_FUNC get_builtin_name(int i) | |||
8229 | if (i < ARRAY_SIZE(bltins2)) { | 8229 | if (i < ARRAY_SIZE(bltins2)) { |
8230 | return bltins2[i].b_cmd; | 8230 | return bltins2[i].b_cmd; |
8231 | } | 8231 | } |
8232 | # if ENABLE_HUSH_FUNCTIONS | ||
8233 | i -= ARRAY_SIZE(bltins2); | ||
8234 | for (struct function *funcp = G.top_func; funcp; funcp = funcp->next) { | ||
8235 | if (i-- <= 0) | ||
8236 | return funcp->name; | ||
8237 | } | ||
8238 | # endif | ||
8232 | return NULL; | 8239 | return NULL; |
8233 | } | 8240 | } |
8234 | #endif | 8241 | #endif |
@@ -10716,7 +10723,7 @@ int hush_main(int argc, char **argv) | |||
10716 | # if ENABLE_FEATURE_EDITING | 10723 | # if ENABLE_FEATURE_EDITING |
10717 | G.line_input_state = new_line_input_t(FOR_SHELL); | 10724 | G.line_input_state = new_line_input_t(FOR_SHELL); |
10718 | # if ENABLE_FEATURE_TAB_COMPLETION | 10725 | # if ENABLE_FEATURE_TAB_COMPLETION |
10719 | G.line_input_state->get_exe_name = get_builtin_name; | 10726 | G.line_input_state->get_exe_name = hush_command_name; |
10720 | # endif | 10727 | # endif |
10721 | # if EDITING_HAS_sh_get_var | 10728 | # if EDITING_HAS_sh_get_var |
10722 | G.line_input_state->sh_get_var = get_local_var_value; | 10729 | G.line_input_state->sh_get_var = get_local_var_value; |