hush: add HUSH_BASH_SOURCE_CURDIR config option, to be on par with ash

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2018-01-27 20:46:45 +01:00
parent f7e0feaf97
commit 54c2111781
2 changed files with 10 additions and 3 deletions

View File

@ -54,14 +54,14 @@
//config:config ASH_BASH_SOURCE_CURDIR //config:config ASH_BASH_SOURCE_CURDIR
//config: bool "'source' and '.' builtins search current directory after $PATH" //config: bool "'source' and '.' builtins search current directory after $PATH"
//config: default n # do not encourage non-standard behavior //config: default n # do not encourage non-standard behavior
//config: depends ASH_BASH_COMPAT //config: depends on ASH_BASH_COMPAT
//config: help //config: help
//config: This is not compliant with standards. Avoid if possible. //config: This is not compliant with standards. Avoid if possible.
//config: //config:
//config:config ASH_BASH_NOT_FOUND_HOOK //config:config ASH_BASH_NOT_FOUND_HOOK
//config: bool "command_not_found_handle hook support" //config: bool "command_not_found_handle hook support"
//config: default y //config: default y
//config: depends ASH_BASH_COMPAT //config: depends on ASH_BASH_COMPAT
//config: help //config: help
//config: Enable support for the 'command_not_found_handle' hook function, //config: Enable support for the 'command_not_found_handle' hook function,
//config: from GNU bash, which allows for alternative command not found //config: from GNU bash, which allows for alternative command not found

View File

@ -120,6 +120,13 @@
//config: help //config: help
//config: Enable {abc,def} extension. //config: Enable {abc,def} extension.
//config: //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:config HUSH_INTERACTIVE
//config: bool "Interactive mode" //config: bool "Interactive mode"
//config: default y //config: default y
@ -10211,7 +10218,7 @@ static int FAST_FUNC builtin_source(char **argv)
arg_path = find_in_path(filename); arg_path = find_in_path(filename);
if (arg_path) if (arg_path)
filename = 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; errno = ENOENT;
bb_simple_perror_msg(filename); bb_simple_perror_msg(filename);
return EXIT_FAILURE; return EXIT_FAILURE;