From 93d86b7e5cc58fcb0c44f0666cdc05052cc8e8e2 Mon Sep 17 00:00:00 2001 From: Austin Beer Date: Wed, 24 Oct 2018 18:56:12 -0600 Subject: Prevent Bash from searching $PATH when sourcing the .config file diff --git a/scripts/functions b/scripts/functions index 790533c..f6e3aeb 100644 --- a/scripts/functions +++ b/scripts/functions @@ -13,7 +13,7 @@ CT_LoadConfig() { # It also sets KERNEL/ARCH/... for file inclusion below. Does not handle # recursive definitions yet. We don't need arrays at this point. CT_TestOrAbort "Configuration file not found. Please create one." -r .config - . .config + . ./.config # Include sub-scripts instead of calling them: that way, we do not have to # export any variable, nor re-parse the configuration and functions files. @@ -37,7 +37,7 @@ CT_LoadConfig() { oldvals="" try=0 while [ "$try" -le 10 ]; do - . .config + . ./.config vals=`set | ${grep} -E '^CT_'` if [ "$oldvals" = "$vals" ]; then break -- cgit v0.10.2-6-g49f6 From 11e65e75f9cc3e89d9efa3891445796453284cd2 Mon Sep 17 00:00:00 2001 From: Austin Beer Date: Thu, 25 Oct 2018 15:07:55 -0600 Subject: Add comment about preventing Bash from searching $PATH diff --git a/scripts/functions b/scripts/functions index f6e3aeb..1b753ef 100644 --- a/scripts/functions +++ b/scripts/functions @@ -13,7 +13,7 @@ CT_LoadConfig() { # It also sets KERNEL/ARCH/... for file inclusion below. Does not handle # recursive definitions yet. We don't need arrays at this point. CT_TestOrAbort "Configuration file not found. Please create one." -r .config - . ./.config + . ./.config # Prefixing with ./ prevents Bash from searching $PATH # Include sub-scripts instead of calling them: that way, we do not have to # export any variable, nor re-parse the configuration and functions files. @@ -37,7 +37,7 @@ CT_LoadConfig() { oldvals="" try=0 while [ "$try" -le 10 ]; do - . ./.config + . ./.config # Prefixing with ./ prevents Bash from searching $PATH vals=`set | ${grep} -E '^CT_'` if [ "$oldvals" = "$vals" ]; then break -- cgit v0.10.2-6-g49f6