summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2020-12-16 10:01:21 +0100
committerDenys Vlasenko2020-12-16 10:01:21 +0100
commiteaced1ec85315b9e11226f9a4ab935066e6946a0 (patch)
treebea583562fd97d915c4904b345131773b8d45819
parent8baa643a3445882ec9c39dfcabb7374081c13aee (diff)
downloadbusybox-eaced1ec85315b9e11226f9a4ab935066e6946a0.zip
busybox-eaced1ec85315b9e11226f9a4ab935066e6946a0.tar.gz
lineedit: remove ->path_lookup if ash is not configured
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--include/libbb.h16
-rw-r--r--libbb/lineedit.c2
2 files changed, 13 insertions, 5 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 202e3f3..6b71414 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1863,14 +1863,20 @@ typedef const char *get_exe_name_t(int i) FAST_FUNC;
typedef struct line_input_t {
int flags;
int timeout;
+# if ENABLE_FEATURE_TAB_COMPLETION
+# if ENABLE_SHELL_ASH
const char *path_lookup;
-# if ENABLE_FEATURE_TAB_COMPLETION \
-&& (ENABLE_ASH || ENABLE_SH_IS_ASH || ENABLE_BASH_IS_ASH \
-|| ENABLE_HUSH || ENABLE_SH_IS_HUSH || ENABLE_BASH_IS_HUSH \
-)
+# define EDITING_HAS_path_lookup 1
+# else
+# define EDITING_HAS_path_lookup 0
+# endif
+# if ENABLE_SHELL_ASH || ENABLE_SHELL_HUSH
/* function to fetch additional application-specific names to match */
get_exe_name_t *get_exe_name;
-# define EDITING_HAS_get_exe_name 1
+# define EDITING_HAS_get_exe_name 1
+# else
+# define EDITING_HAS_get_exe_name 0
+# endif
# endif
# if MAX_HISTORY
int cnt_history;
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 5eb701f..1a3f296 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -743,9 +743,11 @@ static int path_parse(char ***p)
char *tmp;
char **res;
+#if EDITING_HAS_path_lookup
if (state->flags & WITH_PATH_LOOKUP)
pth = state->path_lookup;
else
+#endif
pth = getenv("PATH");
/* PATH="" or PATH=":"? */