aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/lineedit.c17
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)
}
pf_len = strlen(pfind);
-# if ENABLE_FEATURE_SH_STANDALONE && NUM_APPLETS != 1
if (type == FIND_EXE_ONLY && !dirbuf) {
+# if ENABLE_FEATURE_SH_STANDALONE && NUM_APPLETS != 1
const char *p = applet_names;
-
while (*p) {
if (strncmp(pfind, p, pf_len) == 0)
add_match(xstrdup(p));
while (*p++ != '\0')
continue;
}
- }
# endif
+# if EDITING_HAS_get_exe_name
+ if (state->get_exe_name) {
+ i = 0;
+ for (;;) {
+ const char *b = state->get_exe_name(i++);
+ if (!b)
+ break;
+ if (strncmp(pfind, b, pf_len) == 0)
+ add_match(xstrdup(b));
+ }
+ }
+# endif
+ }
for (i = 0; i < npaths; i++) {
DIR *dir;