summaryrefslogtreecommitdiff
path: root/Modules/FindSubversion.cmake
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2010-10-07 16:30:01 +0200
committerBrad King <brad.king@kitware.com>2010-10-07 11:10:40 -0400
commitd2f8c5f8ab657f35d71f1f4a67721ead7ee622c4 (patch)
tree036f7f9b4ee2258680675e0680d696d29ccfdbf7 /Modules/FindSubversion.cmake
parent42126aaf6ca83bbfbebab364a026763f62770bf7 (diff)
downloadcmake-d2f8c5f8ab657f35d71f1f4a67721ead7ee622c4.tar.gz
FindSubversion: Use C locale to detect version (#11273)
Force LC_ALL to C before the call of the svn executable as it is done in the Subversion_WC_INFO macro a few lines below.
Diffstat (limited to 'Modules/FindSubversion.cmake')
-rw-r--r--Modules/FindSubversion.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake
index 61e02535e2..3561a19d5e 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -52,12 +52,19 @@ FIND_PROGRAM(Subversion_SVN_EXECUTABLE svn
MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE)
IF(Subversion_SVN_EXECUTABLE)
+ # the subversion commands should be executed with the C locale, otherwise
+ # the message (which are parsed) may be translated, Alex
+ SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
+ SET(ENV{LC_ALL} C)
EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version
OUTPUT_VARIABLE Subversion_VERSION_SVN
OUTPUT_STRIP_TRAILING_WHITESPACE)
- STRING(REGEX REPLACE "^(.*\n)?svn, [Vv]ersion ([.0-9]+).*"
+ # restore the previous LC_ALL
+ SET(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
+
+ STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*"
"\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}")
MACRO(Subversion_WC_INFO dir prefix)