aboutsummaryrefslogtreecommitdiff
path: root/libbb/lineedit.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r--libbb/lineedit.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 9bb3ea98b..14eb16873 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -884,18 +884,29 @@ static NOINLINE unsigned complete_cmd_dir_file(const char *command, int type)
884 } 884 }
885 pf_len = strlen(pfind); 885 pf_len = strlen(pfind);
886 886
887# if ENABLE_FEATURE_SH_STANDALONE && NUM_APPLETS != 1
888 if (type == FIND_EXE_ONLY && !dirbuf) { 887 if (type == FIND_EXE_ONLY && !dirbuf) {
888# if ENABLE_FEATURE_SH_STANDALONE && NUM_APPLETS != 1
889 const char *p = applet_names; 889 const char *p = applet_names;
890
891 while (*p) { 890 while (*p) {
892 if (strncmp(pfind, p, pf_len) == 0) 891 if (strncmp(pfind, p, pf_len) == 0)
893 add_match(xstrdup(p)); 892 add_match(xstrdup(p));
894 while (*p++ != '\0') 893 while (*p++ != '\0')
895 continue; 894 continue;
896 } 895 }
897 }
898# endif 896# endif
897# if EDITING_HAS_get_exe_name
898 if (state->get_exe_name) {
899 i = 0;
900 for (;;) {
901 const char *b = state->get_exe_name(i++);
902 if (!b)
903 break;
904 if (strncmp(pfind, b, pf_len) == 0)
905 add_match(xstrdup(b));
906 }
907 }
908# endif
909 }
899 910
900 for (i = 0; i < npaths; i++) { 911 for (i = 0; i < npaths; i++) {
901 DIR *dir; 912 DIR *dir;