diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-01-27 19:05:59 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-01-27 19:05:59 +0100 |
commit | f7e0feaf977ea5fef0f0819ba67a47dbef9b2e1a (patch) | |
tree | 9032aeeacc7af878046f560c920aedee67870843 | |
parent | bb373dbc3297748623dec26798a631a4530122ec (diff) | |
download | busybox-w32-f7e0feaf977ea5fef0f0819ba67a47dbef9b2e1a.tar.gz busybox-w32-f7e0feaf977ea5fef0f0819ba67a47dbef9b2e1a.tar.bz2 busybox-w32-f7e0feaf977ea5fef0f0819ba67a47dbef9b2e1a.zip |
hush: fix dot builtin to not search current directory
function old new delta
builtin_source 182 209 +27
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/hush.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c index cf3c731bc..2d1cc5ca6 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -10211,6 +10211,11 @@ static int FAST_FUNC builtin_source(char **argv) | |||
10211 | arg_path = find_in_path(filename); | 10211 | arg_path = find_in_path(filename); |
10212 | if (arg_path) | 10212 | if (arg_path) |
10213 | filename = arg_path; | 10213 | filename = arg_path; |
10214 | else /* add "if (!HUSH_BASH_SOURCE_CURDIR)" if users want bash-compat */ { | ||
10215 | errno = ENOENT; | ||
10216 | bb_simple_perror_msg(filename); | ||
10217 | return EXIT_FAILURE; | ||
10218 | } | ||
10214 | } | 10219 | } |
10215 | input = remember_FILE(fopen_or_warn(filename, "r")); | 10220 | input = remember_FILE(fopen_or_warn(filename, "r")); |
10216 | free(arg_path); | 10221 | free(arg_path); |