ICU-527 Don't crash if setlocale() returns NULL
X-SVN-Rev: 2099
This commit is contained in:
parent
afbd051d76
commit
6fa70ecf4a
@ -1268,8 +1268,10 @@ static const char *uprv_getPOSIXID()
|
||||
if (posixID == 0) posixID = getenv("LANG");
|
||||
if (posixID == 0) posixID = setlocale(LC_ALL, NULL);
|
||||
|
||||
if ( (uprv_strcmp("C", posixID) == 0) ||
|
||||
(uprv_strncmp("C ", posixID, 2) == 0) ) { /* HPUX returns 'C C C C C C C' */
|
||||
if ( (posixID==0) ||
|
||||
(uprv_strcmp("C", posixID) == 0) ||
|
||||
(uprv_strncmp("C ", posixID, 2) == 0) )
|
||||
{ /* HPUX returns 'C C C C C C C' */
|
||||
posixID = "en_US";
|
||||
}
|
||||
return posixID;
|
||||
|
Loading…
Reference in New Issue
Block a user