← Commit list

f23264b35

Ron Yorston
Ron Yorston
2015-10-30
SUCCESS Duration: 227s

Subject

lineedit: search applets as well as PATH for tab completion

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/lineedit.c+16 -1
@@ -47,7 +47,8 @@
* It stems from simplistic "cmdedit_y = cmdedit_prmt_len / cmdedit_termw"
* calculation of how many lines the prompt takes.
*/
-#include "libbb.h"
+#include "busybox.h"
+#include "NUM_APPLETS.h"
#include "unicode.h"
#ifndef _POSIX_VDISABLE
# define _POSIX_VDISABLE '\0'
@@ -774,6 +775,20 @@ 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) {
+ const char *p = applet_names;
+
+ i = 0;
+ while (i < NUM_APPLETS) {
+ if (strncmp(pfind, p, pf_len) == 0)
+ add_match(xstrdup(p));
+ p += strlen(p) + 1;
+ i++;
+ }
+ }
+#endif
+
for (i = 0; i < npaths; i++) {
DIR *dir;
struct dirent *next;