diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-01-26 15:15:43 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-01-26 15:15:43 +0100 |
commit | 01f7b9e182e257c12f7a7dec76c6b4168605ecd2 (patch) | |
tree | cdf2c50ca857277191a0ca174789c3e1ed897687 | |
parent | e50396298118b1076511f86af373434292102960 (diff) | |
download | busybox-w32-01f7b9e182e257c12f7a7dec76c6b4168605ecd2.tar.gz busybox-w32-01f7b9e182e257c12f7a7dec76c6b4168605ecd2.tar.bz2 busybox-w32-01f7b9e182e257c12f7a7dec76c6b4168605ecd2.zip |
ash: introduce a config option to search current directory for sourced files
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/ash.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index 865159d20..d2c937283 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -51,6 +51,13 @@ | |||
51 | //config: default y | 51 | //config: default y |
52 | //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH | 52 | //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH |
53 | //config: | 53 | //config: |
54 | //config:config ASH_BASH_SOURCE_CURDIR | ||
55 | //config: bool "'source' and '.' builtins search current directory after $PATH" | ||
56 | //config: default n # do not encourage non-standard behavior | ||
57 | //config: depends ASH_BASH_COMPAT | ||
58 | //config: help | ||
59 | //config: This is not compliant with standards. Avoid if possible. | ||
60 | //config: | ||
54 | //config:config ASH_BASH_NOT_FOUND_HOOK | 61 | //config:config ASH_BASH_NOT_FOUND_HOOK |
55 | //config: bool "command_not_found_handle hook support" | 62 | //config: bool "command_not_found_handle hook support" |
56 | //config: default y | 63 | //config: default y |
@@ -12978,10 +12985,14 @@ find_dot_file(char *name) | |||
12978 | if (fullname != name) | 12985 | if (fullname != name) |
12979 | stunalloc(fullname); | 12986 | stunalloc(fullname); |
12980 | } | 12987 | } |
12988 | /* not found in PATH */ | ||
12981 | 12989 | ||
12982 | /* not found in the PATH */ | 12990 | #if ENABLE_ASH_BASH_SOURCE_CURDIR |
12991 | return name; | ||
12992 | #else | ||
12983 | ash_msg_and_raise_error("%s: not found", name); | 12993 | ash_msg_and_raise_error("%s: not found", name); |
12984 | /* NOTREACHED */ | 12994 | /* NOTREACHED */ |
12995 | #endif | ||
12985 | } | 12996 | } |
12986 | 12997 | ||
12987 | static int FAST_FUNC | 12998 | static int FAST_FUNC |