From bae3c15416812aa72be20094d22c33753f9d6b87 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 19 Sep 2008 23:24:02 +0200 Subject: rtab: Prevent endless loops --- etc/functions/rtab | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'etc/functions/rtab') diff --git a/etc/functions/rtab b/etc/functions/rtab index e3a0c20..2fcbf42 100644 --- a/etc/functions/rtab +++ b/etc/functions/rtab @@ -61,10 +61,10 @@ tree=(${(s:/:)dir}) expn=(a b) part='' i=0 - until [[ (( ${#expn} == 1 )) || $dir = $expn ]] do + until [[ (( ${#expn} == 1 )) || $dir = $expn || $i -gt 99 ]] do (( i++ )) part+=$dir[$i] - expn=($(echo ${part}*)) + expn=($(echo ${part}*(/))) (( short )) && break done result+="/$part" -- cgit v1.2.3