From f78f51e2a7cbbbfc464e4761b0d70505dd4edb92 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 6 Sep 2016 18:13:17 +0200 Subject: [PATCH] dirh: Don't rely on negative increments in seq Not available in BSD seq. Fixes #3354. --- share/functions/dirh.fish | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/functions/dirh.fish b/share/functions/dirh.fish index 942b1ed95..b75560638 100644 --- a/share/functions/dirh.fish +++ b/share/functions/dirh.fish @@ -9,7 +9,9 @@ function dirh --description "Print the current directory history (the prev and n set -l dirc (count $dirprev) 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] end