aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2020-12-16 10:01:21 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2020-12-16 10:01:21 +0100
commiteaced1ec85315b9e11226f9a4ab935066e6946a0 (patch)
treebea583562fd97d915c4904b345131773b8d45819
parent8baa643a3445882ec9c39dfcabb7374081c13aee (diff)
downloadbusybox-w32-eaced1ec85315b9e11226f9a4ab935066e6946a0.tar.gz
busybox-w32-eaced1ec85315b9e11226f9a4ab935066e6946a0.tar.bz2
busybox-w32-eaced1ec85315b9e11226f9a4ab935066e6946a0.zip
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 202e3f39c..6b7141456 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1863,14 +1863,20 @@ typedef const char *get_exe_name_t(int i) FAST_FUNC;
1863typedef struct line_input_t { 1863typedef struct line_input_t {
1864 int flags; 1864 int flags;
1865 int timeout; 1865 int timeout;
1866# if ENABLE_FEATURE_TAB_COMPLETION
1867# if ENABLE_SHELL_ASH
1866 const char *path_lookup; 1868 const char *path_lookup;
1867# if ENABLE_FEATURE_TAB_COMPLETION \ 1869# define EDITING_HAS_path_lookup 1
1868&& (ENABLE_ASH || ENABLE_SH_IS_ASH || ENABLE_BASH_IS_ASH \ 1870# else
1869|| ENABLE_HUSH || ENABLE_SH_IS_HUSH || ENABLE_BASH_IS_HUSH \ 1871# define EDITING_HAS_path_lookup 0
1870) 1872# endif
1873# if ENABLE_SHELL_ASH || ENABLE_SHELL_HUSH
1871 /* function to fetch additional application-specific names to match */ 1874 /* function to fetch additional application-specific names to match */
1872 get_exe_name_t *get_exe_name; 1875 get_exe_name_t *get_exe_name;
1873# define EDITING_HAS_get_exe_name 1 1876# define EDITING_HAS_get_exe_name 1
1877# else
1878# define EDITING_HAS_get_exe_name 0
1879# endif
1874# endif 1880# endif
1875# if MAX_HISTORY 1881# if MAX_HISTORY
1876 int cnt_history; 1882 int cnt_history;
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 5eb701f00..1a3f29656 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -743,9 +743,11 @@ static int path_parse(char ***p)
743 char *tmp; 743 char *tmp;
744 char **res; 744 char **res;
745 745
746#if EDITING_HAS_path_lookup
746 if (state->flags & WITH_PATH_LOOKUP) 747 if (state->flags & WITH_PATH_LOOKUP)
747 pth = state->path_lookup; 748 pth = state->path_lookup;
748 else 749 else
750#endif
749 pth = getenv("PATH"); 751 pth = getenv("PATH");
750 752
751 /* PATH="" or PATH=":"? */ 753 /* PATH="" or PATH=":"? */