summaryrefslogtreecommitdiffstats
path: root/libcxx/src/support/win32/locale_win32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/src/support/win32/locale_win32.cpp')
-rw-r--r--libcxx/src/support/win32/locale_win32.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libcxx/src/support/win32/locale_win32.cpp b/libcxx/src/support/win32/locale_win32.cpp
index 02b5874e294..e8c630c1faf 100644
--- a/libcxx/src/support/win32/locale_win32.cpp
+++ b/libcxx/src/support/win32/locale_win32.cpp
@@ -20,6 +20,8 @@ locale_t newlocale( int mask, const char * locale, locale_t /*base*/ )
locale_t uselocale( locale_t newloc )
{
locale_t old_locale = _get_current_locale();
+ if ( newloc == NULL )
+ return old_locale;
// uselocale sets the thread's locale by definition, so unconditionally use thread-local locale
_configthreadlocale( _ENABLE_PER_THREAD_LOCALE );
// uselocale sets all categories
OpenPOWER on IntegriCloud