aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2023-07-08 08:19:02 +0200
committerUlrich Müller <ulm@gentoo.org>2023-07-08 08:19:02 +0200
commitc6ee01faaeabcab22b29e8d3f671ba6fd7d00724 (patch)
tree7d04edb4ec906e5c9e4f01ed826a2edaabffcc47
parentenv.eselect: Fix typos in comments (diff)
downloadeselect-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--ChangeLog4
-rwxr-xr-xbin/eselect.in3
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 65a49f0..932edc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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