From 74e606a270c5a05f93afa584979f65f15005ac33 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 10 Oct 2008 09:36:16 -0400 Subject: ENH: play it safe and restore the value of LC_MESSAGES --- Source/CTest/cmCTestUpdateHandler.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index d24d8f3..e6a6073 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -253,7 +253,12 @@ int cmCTestUpdateHandler::ProcessHandler() std::string errors; // make sure + std::string saveLCMessages; const char* lcmess = cmSystemTools::GetEnv("LC_MESSAGES"); + if(lcmess) + { + saveLCMessages = lcmess; + } // if LC_MESSAGES is not set to en_EN, then // set it, so that svn/cvs info will be in english if(! (lcmess && strcmp(lcmess, "en_EN") == 0)) @@ -1110,7 +1115,18 @@ int cmCTestUpdateHandler::ProcessHandler() } os << "" << std::endl; os << "" << std::endl; - + // restore the value of LC_MESSAGES after running the version control + // commands + if(saveLCMessages.size()) + { + std::string put = "LC_MESSAGES="; + put += saveLCMessages; + cmSystemTools::PutEnv(put.c_str()); + } + else + { + cmSystemTools::UnsetEnv("LC_MESSAGES"); + } if (! res ) { cmCTestLog(this->CTest, ERROR_MESSAGE, -- cgit v0.12