aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/lineedit.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index aef1911d9..618e7c221 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -812,14 +812,20 @@ static NOINLINE unsigned complete_cmd_dir_file(const char *command, int type)
812 } 812 }
813 pf_len = strlen(pfind); 813 pf_len = strlen(pfind);
814 814
815# if ENABLE_FEATURE_SH_STANDALONE && NUM_APPLETS != 1 815# if ENABLE_FEATURE_SH_STANDALONE && (NUM_APPLETS != 1 || NUM_SCRIPTS > 0)
816 if (type == FIND_EXE_ONLY && !dirbuf) { 816 if (type == FIND_EXE_ONLY && !dirbuf) {
817 const char *p = applet_names; 817 const char *p;
818 818# if NUM_APPLETS != 1 && NUM_SCRIPTS > 0
819 for (i = 0, p = applet_names; i < 2; i++, p = script_names)
820# elif NUM_APPLETS != 1 /* and NUM_SCRIPTS == 0 */
821 p = applet_names;
822# else /* NUM_APPLETS == 1 && NUM_SCRIPTS > 0 */
823 p = script_names;
824# endif
819 while (*p) { 825 while (*p) {
820 if (strncmp(pfind, p, pf_len) == 0) 826 if (strncmp(pfind, p, pf_len) == 0)
821 add_match(xstrdup(p)); 827 add_match(xstrdup(p));
822 while (*p++ != '\0') 828 while (*p++)
823 continue; 829 continue;
824 } 830 }
825 } 831 }