summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/functions/rtab9
1 files changed, 4 insertions, 5 deletions
diff --git a/etc/functions/rtab b/etc/functions/rtab
index 360e551..bb7d225 100644
--- a/etc/functions/rtab
+++ b/etc/functions/rtab
@@ -53,11 +53,9 @@ tree=(${(s:/:)dir})
cd /
}
for dir in $tree; {
- if (( lastfull )) {
- if [[ $dir == $tree[-1] ]] {
- result+="/$tree[-1]"
- break
- }
+ if (( lastfull && $#tree == 1 )) {
+ result+="/$tree"
+ break
}
expn=(a b)
part=''
@@ -70,6 +68,7 @@ tree=(${(s:/:)dir})
done
result+="/$part"
cd $dir
+ shift tree
}
echo $result
)