]> git.pld-linux.org Git - projects/setup.git/commitdiff
- only export var in zsh if var is actually set
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Thu, 24 Feb 2011 19:17:44 +0000 (19:17 +0000)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Thu, 24 Feb 2011 19:17:44 +0000 (19:17 +0000)
Changed files:
    etc/profile -> 1.56

etc/profile

index 64adc52bd5495303666c46aa9a2b4b68d4f682d6..00c85dcaa58f8ce6238c63658fde6e2e612cf4f2 100644 (file)
@@ -128,7 +128,18 @@ else
                                ;;
                        * )
                                if [ -r "$i" ]; then
-                                       . "$i"; export "$NAME"
+                                       . "$i"
+                                       # export VAR will set and export VAR
+                                       # if it didn't exist before. Other shells
+                                       # (ksh, bash) behave differently.
+                                       if [ -n "$ZSH_VERSION" ]; then
+                                               # zsh specific
+                                               if [ "${(P)+NAME}" = "1" ]; then
+                                                       export "$NAME"
+                                               fi
+                                       else
+                                               export "$NAME"
+                                       fi
                                fi
                                ;;
                esac
This page took 0.035647 seconds and 4 git commands to generate.