dirh: Don't rely on negative increments in seq

Not available in BSD seq.

Fixes #3354.
This commit is contained in:
Fabian Homborg 2016-09-06 18:13:17 +02:00
parent 578e4e8207
commit f78f51e2a7

View file

@ -9,7 +9,9 @@ function dirh --description "Print the current directory history (the prev and n
set -l dirc (count $dirprev) set -l dirc (count $dirprev)
set -l dirprev_rev $dirprev[-1..1] set -l dirprev_rev $dirprev[-1..1]
for i in (seq $dirc -1 1) # This can't be (seq $dirc -1 1) because of BSD.
set -l dirnum (seq 1 $dirc)
for i in $dirnum[-1..1]
printf '%2d) %s\n' $i $dirprev_rev[$i] printf '%2d) %s\n' $i $dirprev_rev[$i]
end end