aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-12-17 12:03:56 -0800
committerKaz Kylheku <kaz@kylheku.com>2024-12-17 12:04:19 -0800
commitac7f3c3f8f53773b42d33b901f73c615c60479ad (patch)
tree8e21e52ab45209ab67bbbf916f64ca44328beac9
parent9b6e4e35fb1a123b28d17b0086116b6b62c1ea56 (diff)
downloadcdlog-ac7f3c3f8f53773b42d33b901f73c615c60479ad.tar.gz
cdlog-ac7f3c3f8f53773b42d33b901f73c615c60479ad.tar.bz2
cdlog-ac7f3c3f8f53773b42d33b901f73c615c60479ad.zip
bug: cd history not working when not in cdlog_lru mode.
* cdlog.sh (cdlog.chdir): The loop which shifts entries into the log must terminate at 1 not 2. The loop body must expand the d[] variable properly.
-rw-r--r--cdlog.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/cdlog.sh b/cdlog.sh
index f43defb..d8aa931 100644
--- a/cdlog.sh
+++ b/cdlog.sh
@@ -241,8 +241,8 @@ cdlog.chdir()
pv=$nx
done
else
- for ((i = ${#d[@]}; i >= 2; i--)); do
- d[$((i+1))]=d[$i]
+ for ((i = ${#d[@]}; i >= 1; i--)); do
+ d[$((i+1))]=${d[$i]}
done
d[1]=$cur