Merge remote-tracking branch 'origin/github/pr/77'
[grml-etc-core.git] / etc / zsh / zshenv
index 954ca38..9a97788 100644 (file)
@@ -51,8 +51,8 @@ fi
 
 # support extra scripts/software in special directory outside of squashfs environment in live mode
 if [[ -f /etc/grml_cd ]] ; then
-    [[ -r /lib/live/mount/medium/scripts ]] && ADDONS='/lib/live/mount/medium/scripts'
-    [[ -r /etc/grml/my_path ]] && ADDONS="$(cat /etc/grml/my_path)"
+  [[ -r /run/live/medium/scripts ]] && ADDONS='/run/live/medium/scripts'
+  [[ -r /etc/grml/my_path ]] && ADDONS="$(cat /etc/grml/my_path)"
 fi
 
 # Solaris
@@ -90,17 +90,21 @@ if (( EUID != 0 )); then
   )
 else
   path=(
+    $HOME/bin
+    /usr/local/sbin
+    /usr/local/bin
     /sbin
     /bin
     /usr/sbin
     /usr/bin
-    /usr/local/sbin
-    /usr/local/bin
     "${ADDONS}"
     "${path[@]}"
   )
 fi
 
+# remove empty components to avoid '::' ending up + resulting in './' being in $PATH
+path=( "${path[@]:#}" )
+
 typeset -U path
 
 # less (:=pager) options: