aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox/0001-ash-introduce-a-config-option-to-search-current.patch
blob: 4e9d3c4bf75ac674d37c4cefe8a6a97e18645dbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From 01f7b9e182e257c12f7a7dec76c6b4168605ecd2 Mon Sep 17 00:00:00 2001
From: Denys Vlasenko <vda.linux@googlemail.com>
Date: Fri, 26 Jan 2018 15:15:43 +0100
Subject: ash: introduce a config option to search current directory for
 sourced files

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
 shell/ash.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/shell/ash.c b/shell/ash.c
index 865159d..d2c9372 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -51,6 +51,13 @@
 //config:	default y
 //config:	depends on ASH || SH_IS_ASH || BASH_IS_ASH
 //config:
+//config:config ASH_BASH_SOURCE_CURDIR
+//config:	bool "'source' and '.' builtins search current directory after $PATH"
+//config:	default n   # do not encourage non-standard behavior
+//config:	depends ASH_BASH_COMPAT
+//config:	help
+//config:	This is not compliant with standards. Avoid if possible.
+//config:
 //config:config ASH_COMMAND_NOT_FOUND_HOOK
 //config:	bool "command_not_found_handle hook support"
 //config:	default y
@@ -12978,10 +12985,14 @@ find_dot_file(char *name)
 		if (fullname != name)
 			stunalloc(fullname);
 	}
+	/* not found in PATH */
 
-	/* not found in the PATH */
+#if ENABLE_ASH_BASH_SOURCE_CURDIR
+	return name;
+#else
 	ash_msg_and_raise_error("%s: not found", name);
 	/* NOTREACHED */
+#endif
 }
 
 static int FAST_FUNC
-- 
cgit v0.12