diff options
author | 2023-07-08 08:19:02 +0200 | |
---|---|---|
committer | 2023-07-08 08:19:02 +0200 | |
commit | c6ee01faaeabcab22b29e8d3f671ba6fd7d00724 (patch) | |
tree | 7d04edb4ec906e5c9e4f01ed826a2edaabffcc47 | |
parent | env.eselect: Fix typos in comments (diff) | |
download | eselect-c6ee01faaeabcab22b29e8d3f671ba6fd7d00724.tar.gz eselect-c6ee01faaeabcab22b29e8d3f671ba6fd7d00724.tar.bz2 eselect-c6ee01faaeabcab22b29e8d3f671ba6fd7d00724.zip |
Avoid subshell on startup
* bin/eselect.in (PATH): Avoid subshell.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | bin/eselect.in | 3 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,7 @@ +2023-07-08 Ulrich Müller <ulm@gentoo.org> + + * bin/eselect.in (PATH): Avoid subshell. + 2023-06-12 Ulrich Müller <ulm@gentoo.org> * configure.ac: Update version to 1.4.25. diff --git a/bin/eselect.in b/bin/eselect.in index 36581e1..ee26b80 100755 --- a/bin/eselect.in +++ b/bin/eselect.in @@ -62,7 +62,8 @@ umask +rx # Sanitise PATH: We don't want to execute Portage's internal helpers # if we're called from an ebuild. IFS=: -read -r -d '' -a path < <(printf '%s\0' "${PATH}") +# Append ${IFS} to prevent any trailing empty field from being dropped +set -f; path=(${PATH}${IFS}); set +f for i in "${!path[@]}"; do [[ ${path[i]} == */portage?(/*)/ebuild-helpers?(/*) ]] && unset "path[i]" done |