aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-08-20 14:07:25 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-08-20 14:07:25 +1200
commitc07355eff9cb528cd97736fef5b2c4b29056f635 (patch)
tree40737c0134f121da9b859bb8f1ae079a6bd9fd62
parentMore conservative expansion for dotfile paths (diff)
downloaddotfiles-c07355eff9cb528cd97736fef5b2c4b29056f635.tar.gz
dotfiles-c07355eff9cb528cd97736fef5b2c4b29056f635.zip
Fix a few variable contamination issues
-rw-r--r--bash/bashrc1
-rw-r--r--bash/bashrc.d/cd.bash1
-rw-r--r--sh/profile1
3 files changed, 3 insertions, 0 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 33155b82..5b55cf93 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -37,4 +37,5 @@ if [[ -d $HOME/.bashrc.d ]]; then
source "$file"
done
fi
+unset file
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash
index 320d614b..1b52fc01 100644
--- a/bash/bashrc.d/cd.bash
+++ b/bash/bashrc.d/cd.bash
@@ -1,6 +1,7 @@
# If given two arguments to cd, replace the first with the second in $PWD,
# emulating a Zsh function that I often find useful; preserves options too
__cd() {
+ local opt OPTERR OPTIND
local -a opts
while getopts elP opt; do
opts[${#opts[@]}]=-$opt
diff --git a/sh/profile b/sh/profile
index 5e4f5891..efe47283 100644
--- a/sh/profile
+++ b/sh/profile
@@ -19,4 +19,5 @@ if [ -d "$HOME"/.profile.d ]; then
. "$file"
done
fi
+unset file