Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: vcs_info and locales



Frank Terbeck wrote:
[...]
>  Here's a patch that does exactly that.

Well, not *exactly*... Mikael just told me on IRC, that I'm un-setting
`LC_ALL' before assigning its old value to `LANG'.

Here's another try.

---------- >8 ----------


From 07cabca511cbfdec4401ff660e078f75f3f6a954 Mon Sep 17 00:00:00 2001
From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 25 Apr 2010 16:00:09 +0200
Subject: PATCH: vcs_info: Avoid locale related problems

This is to avoid problems with output from external commands with non-C
locales as reported by FranÃois Gannaz in workers-27900.
---
 Functions/VCS_Info/vcs_info |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info
index a9e65e1..7ae1123 100644
--- a/Functions/VCS_Info/vcs_info
+++ b/Functions/VCS_Info/vcs_info
@@ -47,11 +47,17 @@ vcs_info () {
     local pat
     local -i found
     local -a enabled disabled dps
-    local -x usercontext vcs rrn
+    local -x usercontext vcs rrn LC_MESSAGES
     local -ix maxexports
     local -ax msgs
     local -Ax vcs_comm
 
+    LC_MESSAGES=C
+    if [[ -n ${LC_ALL} ]]; then
+        local -x LANG
+        LANG=${LC_ALL}
+        local -x LC_ALL
+    fi
     vcs='-init-'; rrn='-all-'
     usercontext=${1:-default}
 
-- 
1.7.0



Messages sorted by: Reverse Date, Date, Thread, Author