locale.cc (locale::locale(const char*)): Deal with locales named "".

2001-12-13  Benjamin Kosnik  <bkoz@redhat.com>

	libstdc++/3679
	* src/locale.cc (locale::locale(const char*)): Deal with locales
	named "".
	* testsuite/22_locale/ctor_copy_dtor.cc (test01): Modify.

From-SVN: r47968
This commit is contained in:
Benjamin Kosnik 2001-12-13 11:12:56 +00:00 committed by Benjamin Kosnik
parent 3af44a8e3f
commit 85230e5255
3 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2001-12-13 Benjamin Kosnik <bkoz@redhat.com>
libstdc++/3679
* src/locale.cc (locale::locale(const char*)): Deal with locales
named "".
* testsuite/22_locale/ctor_copy_dtor.cc (test01): Modify.
2001-12-12 Paolo Carlini <pcarlini@unitus.it>
* include/ext/ropeimpl.h (rope::_S_leaf_concat_char_iter,

View File

@ -204,6 +204,8 @@ namespace std
_S_initialize();
if (strcmp(__s, "C") == 0 || strcmp(__s, "POSIX") == 0)
(_M_impl = _S_classic)->_M_add_reference();
else if (strcmp(__s, "") == 0)
_M_impl = new _Impl(setlocale(LC_ALL, __s), 1);
else
_M_impl = new _Impl(__s, 1);
}

View File

@ -126,7 +126,7 @@ void test01()
locale loc07("");
VERIFY (loc07 != loc01);
VERIFY (loc07 != loc02);
VERIFY (loc07.name() == "");
VERIFY (loc07.name() != "");
try
{ locale loc08(static_cast<const char*>(NULL)); }
catch(runtime_error& obj)