[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 7/8] variables: define default BASH_SOURCE_PATH
From: |
Matheus Afonso Martins Moreira |
Subject: |
[PATCH v2 7/8] variables: define default BASH_SOURCE_PATH |
Date: |
Mon, 13 May 2024 07:37:25 -0300 |
Define a build time configurable default value
for the new BASH_SOURCE_PATH variable.
Look for libraries in the user's home directory
as well as the system wide directories.
Signed-off-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
---
config-top.h | 7 +++++++
variables.c | 1 +
2 files changed, 8 insertions(+)
diff --git a/config-top.h b/config-top.h
index b6e73c4b..65d52cb2 100644
--- a/config-top.h
+++ b/config-top.h
@@ -78,6 +78,13 @@
"/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:."
#endif
+/* The default value of the BASH_SOURCE_PATH variable
+ which is used by source -l instead of PATH. */
+#ifndef DEFAULT_SOURCE_PATH
+#define DEFAULT_SOURCE_PATH \
+
"~/.local/share/bash/source:/usr/local/share/bash/source:/usr/share/bash/source"
+#endif
+
/* Default primary and secondary prompt strings. */
#define PPROMPT "\\s-\\v\\$ "
#define SPROMPT "> "
diff --git a/variables.c b/variables.c
index 84b30d93..eb363332 100644
--- a/variables.c
+++ b/variables.c
@@ -694,6 +694,7 @@ initialize_shell_variables (char **env, int privmode)
uidset ();
temp_var = set_if_not ("BASH_LOADABLES_PATH",
DEFAULT_LOADABLE_BUILTINS_PATH);
+ temp_var = set_if_not ("BASH_SOURCE_PATH", DEFAULT_SOURCE_PATH);
temp_var = find_variable ("BASH_XTRACEFD");
if (temp_var && imported_p (temp_var))
--
2.44.0
[PATCH v2 7/8] variables: define default BASH_SOURCE_PATH,
Matheus Afonso Martins Moreira <=
[PATCH v2 8/8] shell: restrict BASH_SOURCE_PATH when appropriate, Matheus Afonso Martins Moreira, 2024/05/13