From 4f345fdee7166855397e7f83b499d8139fdeae53 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Sun, 2 Jul 2017 21:16:48 -0700 Subject: [PATCH] harden *share/config.fish* against an unset var This is only needed if we make undefined vars an error as proposed in issue #4163 but it's a good idea anyway. --- share/config.fish | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/share/config.fish b/share/config.fish index ef31aee3c..44c4248a6 100644 --- a/share/config.fish +++ b/share/config.fish @@ -254,11 +254,13 @@ end # This needs to be in share/config.fish because __fish_config_interactive is called after sourcing # config.fish, which might contain abbr calls. if not set -q __fish_init_2_3_0 - set -l fab - for abb in $fish_user_abbreviations - set fab $fab (string replace -r '^([^ =]+)=(.*)$' '$1 $2' -- $abb) + if set -q fish_user_abbreviations + set -l fab + for abbr in $fish_user_abbreviations + set fab $fab (string replace -r '^([^ =]+)=(.*)$' '$1 $2' -- $abbr) + end + set fish_user_abbreviations $fab end - set fish_user_abbreviations $fab set -U __fish_init_2_3_0 end