diff options
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r-- | libbb/lineedit.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index b1ec52b88..de236dea0 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -813,18 +813,29 @@ static NOINLINE unsigned complete_cmd_dir_file(const char *command, int type) | |||
813 | } | 813 | } |
814 | pf_len = strlen(pfind); | 814 | pf_len = strlen(pfind); |
815 | 815 | ||
816 | # if ENABLE_FEATURE_SH_STANDALONE && NUM_APPLETS != 1 | ||
817 | if (type == FIND_EXE_ONLY && !dirbuf) { | 816 | if (type == FIND_EXE_ONLY && !dirbuf) { |
817 | # if ENABLE_FEATURE_SH_STANDALONE && NUM_APPLETS != 1 | ||
818 | const char *p = applet_names; | 818 | const char *p = applet_names; |
819 | |||
820 | while (*p) { | 819 | while (*p) { |
821 | if (strncmp(pfind, p, pf_len) == 0) | 820 | if (strncmp(pfind, p, pf_len) == 0) |
822 | add_match(xstrdup(p)); | 821 | add_match(xstrdup(p)); |
823 | while (*p++ != '\0') | 822 | while (*p++ != '\0') |
824 | continue; | 823 | continue; |
825 | } | 824 | } |
826 | } | ||
827 | # endif | 825 | # endif |
826 | # if EDITING_HAS_get_exe_name | ||
827 | if (state->get_exe_name) { | ||
828 | i = 0; | ||
829 | for (;;) { | ||
830 | const char *b = state->get_exe_name(i++); | ||
831 | if (!b) | ||
832 | break; | ||
833 | if (strncmp(pfind, b, pf_len) == 0) | ||
834 | add_match(xstrdup(b)); | ||
835 | } | ||
836 | } | ||
837 | # endif | ||
838 | } | ||
828 | 839 | ||
829 | for (i = 0; i < npaths; i++) { | 840 | for (i = 0; i < npaths; i++) { |
830 | DIR *dir; | 841 | DIR *dir; |