aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/abbr.fish
diff options
context:
space:
mode:
authorGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2014-11-16 23:05:55 +0800
committerGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2014-11-16 23:05:58 +0800
commit206ea15b68c0a6677d1f4eb3d5f978fbaef42606 (patch)
tree26177ee51ff6825a24fc93582fd065004a7ff425 /share/functions/abbr.fish
parenta7bab7b18bea6fe3e1718c10b359e270bada8878 (diff)
abbr.fish: improve support for corner cases
Handle unusual cases ('=abc', ' =abc') better - regression from 8e8e6314due to a7bab7b. Work on #731.
Diffstat (limited to 'share/functions/abbr.fish')
-rw-r--r--share/functions/abbr.fish6
1 files changed, 5 insertions, 1 deletions
diff --git a/share/functions/abbr.fish b/share/functions/abbr.fish
index 2339ca44..fdb6d6ae 100644
--- a/share/functions/abbr.fish
+++ b/share/functions/abbr.fish
@@ -143,15 +143,19 @@ function __fish_abbr_parse_entry -S -a __input __key __value
if test -z "$__value"
set __value _
end
+ set -l IFS '= '
switch $__input
case '=*'
# read will skip any leading ='s, but we don't want that
set __input " $__input"
set __key _
+ set IFS '='
+ case ' =*'
+ set __key _
+ set IFS '='
end
# use read -z to avoid splitting on newlines
# I think we can safely assume there will be no NULs in the input
- set -l IFS '= '
printf "%s" $__input | read -z $__key $__value
return 0
end