various improvements
[distro-setup] / path_add-function
index cc613672b9790c7049eefbac6f837bbfe521b8b0..6f06ed9b2c95dba2766fda574750ca04b3737759 100644 (file)
@@ -24,7 +24,9 @@ path_add() {
         unset IFS
         if ! $found; then
             if ! $ifexists || [ -d $x ]; then
-                if $start; then
+                if [ ! "$PATH" ]; then
+                    PATH="$x"
+                elif $start; then
                     PATH="$x:$PATH"
                 else
                     PATH="$PATH:$x"