From ee646c8dd078eb48b4700161cd9ae8695789bd03 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Thu, 1 Jun 2017 17:58:29 -0700 Subject: [PATCH] move `set -l` to top of function Fixes #4091 --- share/functions/pushd.fish | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/functions/pushd.fish b/share/functions/pushd.fish index 15e509be5..08c9e6fdd 100644 --- a/share/functions/pushd.fish +++ b/share/functions/pushd.fish @@ -1,4 +1,7 @@ function pushd --description 'Push directory to stack' + set -l rot_r + set -l rot_l + if count $argv >/dev/null # check for --help switch $argv[1] @@ -8,8 +11,6 @@ function pushd --description 'Push directory to stack' end # emulate bash by checking if argument of form +n or -n - set -l rot_r - set -l rot_l if string match -qr '^-[0-9]+$' -- $argv[1] set rot_r (string sub -s 2 -- $argv[1]) else if string match -qr '^\+[0-9]+$' -- $argv[1]