zshenv: avoid placing empty components in PATH; reorder root's PATH
[grml-etc-core.git] / etc / zsh / zshenv
index 954ca38..d696b56 100644 (file)
@@ -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: