浏览代码

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

Marc Cornellà 7 年之前
父节点
当前提交
6685aac42c
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      plugins/dircycle/dircycle.plugin.zsh

+ 2 - 0
plugins/dircycle/dircycle.plugin.zsh

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