From 6b946fefb2878781305176a307933ef2931c48ca Mon Sep 17 00:00:00 2001 From: Thilo Six Date: Sun, 5 Feb 2017 15:10:06 +0100 Subject: [PATCH] small fix for sll() * do not pollute dirstack, use 'cd -q' * create interger vars with defined base --- etc/zsh/zshrc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index dfd6159..22b1f1a 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -2824,8 +2824,8 @@ function sll () { fi local file jumpd curdir - local -i RTN LINODE i - local -a SEENINODES + local -i 10 RTN LINODE i + local -a SEENINODES curdir="${PWD}" RTN=0 @@ -2838,8 +2838,8 @@ function sll () { LINODE=$(zstat -L +inode "${file}") for i in ${SEENINODES} ; do if (( ${i} == ${LINODE} )) ; then - builtin cd "${curdir}" - print "link loop detected, aborting!" + builtin cd -q "${curdir}" + print 'link loop detected, aborting!' return 2 fi done @@ -2849,7 +2849,7 @@ function sll () { file="${file:t}" if [[ -d ${jumpd} ]] ; then - builtin cd "${jumpd}" || RTN=1 + builtin cd -q "${jumpd}" || RTN=1 fi file=$(readlink "$file") @@ -2857,7 +2857,7 @@ function sll () { file="${file:t}" if [[ -d ${jumpd} ]] ; then - builtin cd "${jumpd}" || RTN=1 + builtin cd -q "${jumpd}" || RTN=1 fi ls -l "${PWD}/${file}" || RTN=1 @@ -2866,7 +2866,7 @@ function sll () { if (( ${#} >= 1 )) ; then print "" fi - builtin cd "${curdir}" + builtin cd -q "${curdir}" done return ${RTN} } -- 2.1.4