diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-20 14:07:25 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-20 14:07:25 +1200 |
commit | c07355eff9cb528cd97736fef5b2c4b29056f635 (patch) | |
tree | 40737c0134f121da9b859bb8f1ae079a6bd9fd62 /bash | |
parent | More conservative expansion for dotfile paths (diff) | |
download | dotfiles-c07355eff9cb528cd97736fef5b2c4b29056f635.tar.gz dotfiles-c07355eff9cb528cd97736fef5b2c4b29056f635.zip |
Fix a few variable contamination issues
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc | 1 | ||||
-rw-r--r-- | bash/bashrc.d/cd.bash | 1 |
2 files changed, 2 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 |