summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-27 18:34:12 +0000
committerRoy Marples <roy@marples.name>2008-03-27 18:34:12 +0000
commit742310744d61a2bc2553f8c34aededf30fea3f18 (patch)
treeeb0a2080da9ed090f03befbb25d66906d57db046 /sh
parent4e9b58b07da4d95e5303db1372772f3b9ab216f0 (diff)
downloadopenrc-742310744d61a2bc2553f8c34aededf30fea3f18.tar.gz
openrc-742310744d61a2bc2553f8c34aededf30fea3f18.tar.bz2
openrc-742310744d61a2bc2553f8c34aededf30fea3f18.tar.xz
We would sanitize $RC_LIBDIR/sbin as well. If it's really needed then rc-functions.sh will add it back.
Diffstat (limited to 'sh')
-rw-r--r--sh/functions.sh.in8
1 files changed, 5 insertions, 3 deletions
diff --git a/sh/functions.sh.in b/sh/functions.sh.in
index 174adc2..2546233 100644
--- a/sh/functions.sh.in
+++ b/sh/functions.sh.in
@@ -43,7 +43,8 @@ _sanitize_path()
local IFS=":" p= path=
for p in ${PATH}; do
case "${p}" in
- @PREFIX@/@LIB@/rc/bin|@PREFIX@/bin|@PREFIX@/sbin|/usr/bin|/usr/sbin);;
+ @PREFIX@/@LIB@/rc/bin|@PREFIX@/@LIB@/rc/sbin);;
+ @PREFIX@/bin|@PREFIX@/sbin|/usr/bin|/usr/sbin);;
@PKG_PREFIX@/bin|@PKG_PREFIX@/sbin);;
@LOCAL_PREFIX@/bin|@LOCAL_PREFIX@/sbin);;
*) path="${path}${path:+:}${p}";;
@@ -79,8 +80,9 @@ fi
if [ -n "${_LOCAL_PREFIX}" ]; then
_PATH="${_PATH}:${_LOCAL_PREFIX}/bin:${_LOCAL_PREFIX}/sbin"
fi
-export PATH="${_PATH}:$(_sanitize_path "${PATH}")"
-unset _sanitize_path _PREFIX _PKG_PREFIX _LOCAL_PREFIX _PATH
+_path="$(_sanitize_path "${PATH}")"
+export PATH="${_PATH}${_path:+:}${_path}"
+unset _sanitize_path _PREFIX _PKG_PREFIX _LOCAL_PREFIX _PATH _path
for arg; do
case "${arg}" in