1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-25 15:20:08 +00:00

dircycle: fix error on insert-cycledleft if dirstack is empty

This commit is contained in:
Marc Cornellà 2016-11-10 19:46:15 +01:00
parent 0b340bc3a5
commit 6685aac42c

View file

@ -9,6 +9,8 @@
# pushd -N: start counting from right of `dirs' output # pushd -N: start counting from right of `dirs' output
switch-to-dir () { switch-to-dir () {
[[ ${#dirstack} -eq 0 ]] && return
while ! builtin pushd -q $1 &>/dev/null; do while ! builtin pushd -q $1 &>/dev/null; do
# We found a missing directory: pop it out of the dir stack # We found a missing directory: pop it out of the dir stack
builtin popd -q $1 builtin popd -q $1