summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-09-20 17:18:46 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-09-20 17:18:46 +0200
commit95c2403395bd2c1d776ecae8c2325016814d1bb2 (patch)
tree08161eec6a486cb942ec31fd67987fa72e583cee
parent4f9795aba5e2dd238385bb9b37bbc354339aff21 (diff)
rtab: Fixed a bug in -l
As pointed out by mxey: When a path contains the same directory name several times, -l will cut off the path after the first of those names.
-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
)