diff --git a/Source/cmLocale.h b/Source/cmLocale.h index e8e751d1d9..cca7cf5491 100644 --- a/Source/cmLocale.h +++ b/Source/cmLocale.h @@ -6,10 +6,11 @@ #include #include +#include class cmLocaleRAII { - const char* OldLocale; + std::string OldLocale; public: cmLocaleRAII() @@ -17,7 +18,7 @@ public: { setlocale(LC_CTYPE, ""); } - ~cmLocaleRAII() { setlocale(LC_CTYPE, this->OldLocale); } + ~cmLocaleRAII() { setlocale(LC_CTYPE, this->OldLocale.c_str()); } }; #endif