[Solaris] std::locale("/path/to/valid/locale") throws
-----------------------------------------------------

                 Key: STDCXX-342
                 URL: https://issues.apache.org/jira/browse/STDCXX-342
             Project: C++ Standard Library
          Issue Type: Bug
          Components: Locales
    Affects Versions: 4.1.2, 4.1.3
         Environment: Solaris
            Reporter: Martin Sebor


The locale ctors that take a locale name can't deal with absolute pathnames on 
Solaris (see the test case below). That's because the Solaris locale category 
separator is the same as a path separator (i.e., the forward slash character) 
and the ctors do not distinguish one from the other.

$ cat t.cpp && make t && LC_ALL=../nls/en_US.ISO-8859-1 ../bin/locale && ./t 
`cd ../nls && pwd`/en_US.ISO-8859-1
#include <locale>

int main (int, char *argv[])
{
    (void)std::locale (argv [1]);
}
gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG    
-D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include 
-I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/examples/include 
 -pedantic -nostdinc++ -g  -W -Wall -Wcast-qual -Winline -Wshadow 
-Wwrite-strings -Wno-long-long   t.cpp
gcc t.o -o t  -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s  -lsupc++ -lm 
LANG=C
LC_CTYPE="../nls/en_US.ISO-8859-1"
LC_COLLATE="../nls/en_US.ISO-8859-1"
LC_TIME="../nls/en_US.ISO-8859-1"
LC_MONETARY="../nls/en_US.ISO-8859-1"
LC_NUMERIC="../nls/en_US.ISO-8859-1"
LC_MESSAGES="../nls/en_US.ISO-8859-1"
LC_ALL=../nls/en_US.ISO-8859-1
terminate called after throwing an instance of 'std::runtime_error'
  what():  /build/sebor/dev/stdlib/src/locale_combine.cpp:639: 
std::locale::locale(const char*): bad locale name: 
"/build/sebor/gcc-4.1.0-11s/nls/en_US.ISO-8859-1"
Abort (core dumped)


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to