summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2018-01-27 20:46:45 +0100
committerDenys Vlasenko2018-01-27 20:46:45 +0100
commit54c2111781e15b1c70bea43593aa67207f9ea118 (patch)
treea50b5eb078b20b57a5235134df80892d40e07ebd
parentf7e0feaf977ea5fef0f0819ba67a47dbef9b2e1a (diff)
downloadbusybox-54c2111781e15b1c70bea43593aa67207f9ea118.zip
busybox-54c2111781e15b1c70bea43593aa67207f9ea118.tar.gz
hush: add HUSH_BASH_SOURCE_CURDIR config option, to be on par with ash
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/ash.c4
-rw-r--r--shell/hush.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index d2c9372..3fff881 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -54,14 +54,14 @@
//config:config ASH_BASH_SOURCE_CURDIR
//config: bool "'source' and '.' builtins search current directory after $PATH"
//config: default n # do not encourage non-standard behavior
-//config: depends ASH_BASH_COMPAT
+//config: depends on ASH_BASH_COMPAT
//config: help
//config: This is not compliant with standards. Avoid if possible.
//config:
//config:config ASH_BASH_NOT_FOUND_HOOK
//config: bool "command_not_found_handle hook support"
//config: default y
-//config: depends ASH_BASH_COMPAT
+//config: depends on ASH_BASH_COMPAT
//config: help
//config: Enable support for the 'command_not_found_handle' hook function,
//config: from GNU bash, which allows for alternative command not found
diff --git a/shell/hush.c b/shell/hush.c
index 2d1cc5c..ddf3773 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -120,6 +120,13 @@
//config: help
//config: Enable {abc,def} extension.
//config:
+//config:config HUSH_BASH_SOURCE_CURDIR
+//config: bool "'source' and '.' builtins search current directory after $PATH"
+//config: default n # do not encourage non-standard behavior
+//config: depends on HUSH_BASH_COMPAT
+//config: help
+//config: This is not compliant with standards. Avoid if possible.
+//config:
//config:config HUSH_INTERACTIVE
//config: bool "Interactive mode"
//config: default y
@@ -10211,7 +10218,7 @@ static int FAST_FUNC builtin_source(char **argv)
arg_path = find_in_path(filename);
if (arg_path)
filename = arg_path;
- else /* add "if (!HUSH_BASH_SOURCE_CURDIR)" if users want bash-compat */ {
+ else if (!ENABLE_HUSH_BASH_SOURCE_CURDIR) {
errno = ENOENT;
bb_simple_perror_msg(filename);
return EXIT_FAILURE;