diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-01-27 20:46:45 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-01-27 20:46:45 +0100 |
commit | 54c2111781e15b1c70bea43593aa67207f9ea118 (patch) | |
tree | a50b5eb078b20b57a5235134df80892d40e07ebd /shell/hush.c | |
parent | f7e0feaf977ea5fef0f0819ba67a47dbef9b2e1a (diff) | |
download | busybox-w32-54c2111781e15b1c70bea43593aa67207f9ea118.tar.gz busybox-w32-54c2111781e15b1c70bea43593aa67207f9ea118.tar.bz2 busybox-w32-54c2111781e15b1c70bea43593aa67207f9ea118.zip |
hush: add HUSH_BASH_SOURCE_CURDIR config option, to be on par with ash
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to '')
-rw-r--r-- | shell/hush.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c index 2d1cc5ca6..ddf377355 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -120,6 +120,13 @@ | |||
120 | //config: help | 120 | //config: help |
121 | //config: Enable {abc,def} extension. | 121 | //config: Enable {abc,def} extension. |
122 | //config: | 122 | //config: |
123 | //config:config HUSH_BASH_SOURCE_CURDIR | ||
124 | //config: bool "'source' and '.' builtins search current directory after $PATH" | ||
125 | //config: default n # do not encourage non-standard behavior | ||
126 | //config: depends on HUSH_BASH_COMPAT | ||
127 | //config: help | ||
128 | //config: This is not compliant with standards. Avoid if possible. | ||
129 | //config: | ||
123 | //config:config HUSH_INTERACTIVE | 130 | //config:config HUSH_INTERACTIVE |
124 | //config: bool "Interactive mode" | 131 | //config: bool "Interactive mode" |
125 | //config: default y | 132 | //config: default y |
@@ -10211,7 +10218,7 @@ static int FAST_FUNC builtin_source(char **argv) | |||
10211 | arg_path = find_in_path(filename); | 10218 | arg_path = find_in_path(filename); |
10212 | if (arg_path) | 10219 | if (arg_path) |
10213 | filename = arg_path; | 10220 | filename = arg_path; |
10214 | else /* add "if (!HUSH_BASH_SOURCE_CURDIR)" if users want bash-compat */ { | 10221 | else if (!ENABLE_HUSH_BASH_SOURCE_CURDIR) { |
10215 | errno = ENOENT; | 10222 | errno = ENOENT; |
10216 | bb_simple_perror_msg(filename); | 10223 | bb_simple_perror_msg(filename); |
10217 | return EXIT_FAILURE; | 10224 | return EXIT_FAILURE; |