Merge pull request #137 from ilkka/master
Ensure C locale is used when processing command output
This commit is contained in:
@@ -21,7 +21,7 @@ if [ "$shell_command_wrapping_enabled" = "true" ] || [ "$bash_command_wrapping_e
|
|||||||
# Do it in a function so we don't bleed variables
|
# Do it in a function so we don't bleed variables
|
||||||
function _git_wrap_commands() {
|
function _git_wrap_commands() {
|
||||||
# Define 'whence' for bash, to get the value of an alias
|
# Define 'whence' for bash, to get the value of an alias
|
||||||
type whence > /dev/null 2>&1 || function whence() { type "$@" | sed -$SED_REGEX_ARG -e "s/.*is aliased to \`//" -e "s/'$//"; }
|
type whence > /dev/null 2>&1 || function whence() { LC_MESSAGES="C" type "$@" | sed -$SED_REGEX_ARG -e "s/.*is aliased to \`//" -e "s/'$//"; }
|
||||||
local cmd=''
|
local cmd=''
|
||||||
for cmd in $(echo $scmb_wrapped_shell_commands); do
|
for cmd in $(echo $scmb_wrapped_shell_commands); do
|
||||||
if [ "${scmbDebug:-}" = "true" ]; then echo "SCMB: Wrapping $cmd..."; fi
|
if [ "${scmbDebug:-}" = "true" ]; then echo "SCMB: Wrapping $cmd..."; fi
|
||||||
@@ -35,7 +35,7 @@ if [ "$shell_command_wrapping_enabled" = "true" ] || [ "$bash_command_wrapping_e
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$(type $cmd 2>&1)" in
|
case "$(LC_MESSAGES="C" type $cmd 2>&1)" in
|
||||||
|
|
||||||
# Don't do anything if command already aliased, or not found.
|
# Don't do anything if command already aliased, or not found.
|
||||||
*'exec_scmb_expand_args'*)
|
*'exec_scmb_expand_args'*)
|
||||||
@@ -52,7 +52,7 @@ if [ "$shell_command_wrapping_enabled" = "true" ] || [ "$bash_command_wrapping_e
|
|||||||
unalias $cmd
|
unalias $cmd
|
||||||
|
|
||||||
# Detect original $cmd type, and escape
|
# Detect original $cmd type, and escape
|
||||||
case "$(type $cmd 2>&1)" in
|
case "$(LC_MESSAGES="C" type $cmd 2>&1)" in
|
||||||
# Escape shell builtins with 'builtin'
|
# Escape shell builtins with 'builtin'
|
||||||
*'is a shell builtin'*) local escaped_cmd="builtin $cmd";;
|
*'is a shell builtin'*) local escaped_cmd="builtin $cmd";;
|
||||||
# Get full path for files with 'find_binary' function
|
# Get full path for files with 'find_binary' function
|
||||||
|
|||||||
Reference in New Issue
Block a user