From bf35303101df45b43188bacf80840034aef40c45 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sat, 29 Jul 2017 10:03:45 +0100 Subject: ash: remove old code to tab-complete 'busybox' in standalone shell --- libbb/lineedit.c | 12 ++---------- shell/ash.c | 9 +-------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/libbb/lineedit.c b/libbb/lineedit.c index a28b6ef98..a93e28975 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -680,14 +680,6 @@ static void add_match(char *matched) num_matches++; } -#if ENABLE_FEATURE_SH_STANDALONE && NUM_APPLETS != 1 -static void add_partial_match(const char *part, const char *full, int plen) -{ - if (strncmp(part, full, plen) == 0) - add_match(xstrdup(full)); -} -#endif - # if ENABLE_FEATURE_USERNAME_COMPLETION /* Replace "~user/..." with "/homedir/...". * The parameter is malloced, free it or return it @@ -839,11 +831,11 @@ static NOINLINE unsigned complete_cmd_dir_file(const char *command, int type) const char *p = applet_names; while (*p) { - add_partial_match(pfind, p, pf_len); + if (strncmp(pfind, p, pf_len) == 0) + add_match(xstrdup(p)); while (*p++ != '\0') continue; } - add_partial_match(pfind, "busybox", pf_len); } # endif diff --git a/shell/ash.c b/shell/ash.c index 6aaeecfac..b71c749aa 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -8150,11 +8150,6 @@ static void shellexec(char *prog, char **argv, const char *path, int idx) goto try_PATH; } e = errno; -#if ENABLE_PLATFORM_MINGW32 && ENABLE_FEATURE_SH_STANDALONE - } else if (strcmp(argv[0], "busybox") == 0) { - tryexec(-1, bb_busybox_exec_path, argv, envp); - e = errno; -#endif } else { try_PATH: e = ENOENT; @@ -13377,9 +13372,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) #if ENABLE_FEATURE_SH_STANDALONE { int applet_no = find_applet_by_name(name); - if (applet_no >= 0 || - /* requires find_applet_by_name to return -1 on no match */ - (ENABLE_PLATFORM_MINGW32 && strcmp(name, "busybox") == 0)) { + if (applet_no >= 0) { entry->cmdtype = CMDNORMAL; entry->u.index = -2 - applet_no; return; -- cgit v1.2.3-55-g6feb