From ac7f3c3f8f53773b42d33b901f73c615c60479ad Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 17 Dec 2024 12:03:56 -0800 Subject: 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. --- cdlog.sh | 4 ++-- 1 file 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 -- cgit v1.2.3