mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
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.
This commit is contained in:
parent
ea38519a12
commit
4f345fdee7
1 changed files with 6 additions and 4 deletions
|
@ -254,11 +254,13 @@ end
|
||||||
# This needs to be in share/config.fish because __fish_config_interactive is called after sourcing
|
# This needs to be in share/config.fish because __fish_config_interactive is called after sourcing
|
||||||
# config.fish, which might contain abbr calls.
|
# config.fish, which might contain abbr calls.
|
||||||
if not set -q __fish_init_2_3_0
|
if not set -q __fish_init_2_3_0
|
||||||
|
if set -q fish_user_abbreviations
|
||||||
set -l fab
|
set -l fab
|
||||||
for abb in $fish_user_abbreviations
|
for abbr in $fish_user_abbreviations
|
||||||
set fab $fab (string replace -r '^([^ =]+)=(.*)$' '$1 $2' -- $abb)
|
set fab $fab (string replace -r '^([^ =]+)=(.*)$' '$1 $2' -- $abbr)
|
||||||
end
|
end
|
||||||
set fish_user_abbreviations $fab
|
set fish_user_abbreviations $fab
|
||||||
|
end
|
||||||
set -U __fish_init_2_3_0
|
set -U __fish_init_2_3_0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue