Fixed #157: Made 'type' command using default LANG (not system LANG) to check if function or alias.

pull/374/head
Benjamin Brombach 2014-12-03 12:42:54 +01:00
parent 86eba5c436
commit 4b60298939
2 changed files with 2 additions and 2 deletions

View File

@ -235,7 +235,7 @@ draft ()
fi fi
# aliases bind tighter than function names, disallow them # aliases bind tighter than function names, disallow them
if [ -n "$(type -a $func 2>/dev/null | grep 'is.*alias')" ]; then if [ -n "$(LANG=C type -t $func 2>/dev/null | grep 'alias')" ]; then
printf '%s\n' "sorry, $(type -a $func). please choose another name." printf '%s\n' "sorry, $(type -a $func). please choose another name."
return return
fi fi

View File

@ -80,7 +80,7 @@ _is_function ()
_about 'sets $? to true if parameter is the name of a function' _about 'sets $? to true if parameter is the name of a function'
_param '1: name of alleged function' _param '1: name of alleged function'
_group 'lib' _group 'lib'
[ -n "$(type -a $1 2>/dev/null | grep 'is a function')" ] [ -n "$(LANG=C type -t $1 2>/dev/null | grep 'function')" ]
} }
_bash-it-aliases () _bash-it-aliases ()