diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-25 21:38:24 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-25 21:38:24 +1200 |
commit | 86f047cb23d94bd3888e66f9abc8cc8aec6d7acf (patch) | |
tree | ca04fd5853098958f5fb98be73ca36ee4430a398 /bash/bashrc.d/cd.bash | |
parent | No need to test for clear_console existence (diff) | |
download | dotfiles-86f047cb23d94bd3888e66f9abc8cc8aec6d7acf.tar.gz dotfiles-86f047cb23d94bd3888e66f9abc8cc8aec6d7acf.zip |
Initialise OPTIND in cd() function
Diffstat (limited to 'bash/bashrc.d/cd.bash')
-rw-r--r-- | bash/bashrc.d/cd.bash | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash index 0f1eb165..62f1a905 100644 --- a/bash/bashrc.d/cd.bash +++ b/bash/bashrc.d/cd.bash @@ -1,7 +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 OPTIND=0 opt local -a opts while getopts elP opt; do opts[${#opts[@]}]=-$opt |