From a282d0254cca2e9e1e851e251dc77f3b2aa653ce Mon Sep 17 00:00:00 2001 From: Igor Murzov Date: Wed, 14 Aug 2013 11:58:23 +0400 Subject: [PATCH] _longopt: Run commands in C locale. This is a follow-up to commit 822735146f --- bash_completion | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash_completion b/bash_completion index 44af0d1a..d9a53283 100644 --- a/bash_completion +++ b/bash_completion @@ -1781,7 +1781,7 @@ _longopt() return 0 ;; --+([-a-z0-9_])) - local argtype=$( $1 --help 2>&1 | sed -ne \ + local argtype=$( LC_ALL=C $1 --help 2>&1 | sed -ne \ "s|.*$prev\[\{0,1\}=[<[]\{0,1\}\([-A-Za-z0-9_]\{1,\}\).*|\1|p" ) case ${argtype,,} in *dir*) @@ -1799,7 +1799,7 @@ _longopt() $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \ + COMPREPLY=( $( compgen -W "$( LC_ALL=C $1 --help 2>&1 | \ sed -ne 's/.*\(--[-A-Za-z0-9]\{1,\}=\{0,1\}\).*/\1/p' | sort -u )" \ -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace