aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/lineedit.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 7982f2997..8d265a625 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -47,7 +47,8 @@
47 * It stems from simplistic "cmdedit_y = cmdedit_prmt_len / cmdedit_termw" 47 * It stems from simplistic "cmdedit_y = cmdedit_prmt_len / cmdedit_termw"
48 * calculation of how many lines the prompt takes. 48 * calculation of how many lines the prompt takes.
49 */ 49 */
50#include "libbb.h" 50#include "busybox.h"
51#include "NUM_APPLETS.h"
51#include "unicode.h" 52#include "unicode.h"
52#ifndef _POSIX_VDISABLE 53#ifndef _POSIX_VDISABLE
53# define _POSIX_VDISABLE '\0' 54# define _POSIX_VDISABLE '\0'
@@ -824,6 +825,18 @@ static NOINLINE unsigned complete_cmd_dir_file(const char *command, int type)
824 } 825 }
825 pf_len = strlen(pfind); 826 pf_len = strlen(pfind);
826 827
828#if ENABLE_FEATURE_SH_STANDALONE && NUM_APPLETS != 1
829 if (type == FIND_EXE_ONLY) {
830 const char *p = applet_names;
831
832 for (i=0; i < NUM_APPLETS; i++) {
833 if (strncmp(pfind, p, pf_len) == 0)
834 add_match(xstrdup(p));
835 p += strlen(p) + 1;
836 }
837 }
838#endif
839
827 for (i = 0; i < npaths; i++) { 840 for (i = 0; i < npaths; i++) {
828 DIR *dir; 841 DIR *dir;
829 struct dirent *next; 842 struct dirent *next;