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 | |
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>
-rw-r--r-- | shell/ash.c | 4 | ||||
-rw-r--r-- | shell/hush.c | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c index d2c937283..3fff88168 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -54,14 +54,14 @@ | |||
54 | //config:config ASH_BASH_SOURCE_CURDIR | 54 | //config:config ASH_BASH_SOURCE_CURDIR |
55 | //config: bool "'source' and '.' builtins search current directory after $PATH" | 55 | //config: bool "'source' and '.' builtins search current directory after $PATH" |
56 | //config: default n # do not encourage non-standard behavior | 56 | //config: default n # do not encourage non-standard behavior |
57 | //config: depends ASH_BASH_COMPAT | 57 | //config: depends on ASH_BASH_COMPAT |
58 | //config: help | 58 | //config: help |
59 | //config: This is not compliant with standards. Avoid if possible. | 59 | //config: This is not compliant with standards. Avoid if possible. |
60 | //config: | 60 | //config: |
61 | //config:config ASH_BASH_NOT_FOUND_HOOK | 61 | //config:config ASH_BASH_NOT_FOUND_HOOK |
62 | //config: bool "command_not_found_handle hook support" | 62 | //config: bool "command_not_found_handle hook support" |
63 | //config: default y | 63 | //config: default y |
64 | //config: depends ASH_BASH_COMPAT | 64 | //config: depends on ASH_BASH_COMPAT |
65 | //config: help | 65 | //config: help |
66 | //config: Enable support for the 'command_not_found_handle' hook function, | 66 | //config: Enable support for the 'command_not_found_handle' hook function, |
67 | //config: from GNU bash, which allows for alternative command not found | 67 | //config: from GNU bash, which allows for alternative command not found |
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; |