aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2017-07-29 10:03:45 +0100
committerRon Yorston <rmy@pobox.com>2017-07-29 10:03:45 +0100
commitbf35303101df45b43188bacf80840034aef40c45 (patch)
treeb070fe5877d548ca604cab38028f71f62bc1210e
parent86d60bb0ceb277e500a8daabd995bc713bbdadc9 (diff)
downloadbusybox-w32-bf35303101df45b43188bacf80840034aef40c45.tar.gz
busybox-w32-bf35303101df45b43188bacf80840034aef40c45.tar.bz2
busybox-w32-bf35303101df45b43188bacf80840034aef40c45.zip
ash: remove old code to tab-complete 'busybox' in standalone shell
-rw-r--r--libbb/lineedit.c12
-rw-r--r--shell/ash.c9
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)
680 num_matches++; 680 num_matches++;
681} 681}
682 682
683#if ENABLE_FEATURE_SH_STANDALONE && NUM_APPLETS != 1
684static void add_partial_match(const char *part, const char *full, int plen)
685{
686 if (strncmp(part, full, plen) == 0)
687 add_match(xstrdup(full));
688}
689#endif
690
691# if ENABLE_FEATURE_USERNAME_COMPLETION 683# if ENABLE_FEATURE_USERNAME_COMPLETION
692/* Replace "~user/..." with "/homedir/...". 684/* Replace "~user/..." with "/homedir/...".
693 * The parameter is malloced, free it or return it 685 * 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)
839 const char *p = applet_names; 831 const char *p = applet_names;
840 832
841 while (*p) { 833 while (*p) {
842 add_partial_match(pfind, p, pf_len); 834 if (strncmp(pfind, p, pf_len) == 0)
835 add_match(xstrdup(p));
843 while (*p++ != '\0') 836 while (*p++ != '\0')
844 continue; 837 continue;
845 } 838 }
846 add_partial_match(pfind, "busybox", pf_len);
847 } 839 }
848# endif 840# endif
849 841
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)
8150 goto try_PATH; 8150 goto try_PATH;
8151 } 8151 }
8152 e = errno; 8152 e = errno;
8153#if ENABLE_PLATFORM_MINGW32 && ENABLE_FEATURE_SH_STANDALONE
8154 } else if (strcmp(argv[0], "busybox") == 0) {
8155 tryexec(-1, bb_busybox_exec_path, argv, envp);
8156 e = errno;
8157#endif
8158 } else { 8153 } else {
8159 try_PATH: 8154 try_PATH:
8160 e = ENOENT; 8155 e = ENOENT;
@@ -13377,9 +13372,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path)
13377#if ENABLE_FEATURE_SH_STANDALONE 13372#if ENABLE_FEATURE_SH_STANDALONE
13378 { 13373 {
13379 int applet_no = find_applet_by_name(name); 13374 int applet_no = find_applet_by_name(name);
13380 if (applet_no >= 0 || 13375 if (applet_no >= 0) {
13381 /* requires find_applet_by_name to return -1 on no match */
13382 (ENABLE_PLATFORM_MINGW32 && strcmp(name, "busybox") == 0)) {
13383 entry->cmdtype = CMDNORMAL; 13376 entry->cmdtype = CMDNORMAL;
13384 entry->u.index = -2 - applet_no; 13377 entry->u.index = -2 - applet_no;
13385 return; 13378 return;