зеркало из https://github.com/mozilla/pjs.git
Change to pass an empty string to setlocale instead of NULL (which is illegal in Unix unlike windows). Bug
18338, r=tao.
This commit is contained in:
Родитель
d53ae8d00e
Коммит
e2aece84bf
|
@ -219,7 +219,7 @@ nsLocaleService::nsLocaleService(void)
|
|||
nsresult result = nsComponentManager::CreateInstance(kPosixLocaleFactoryCID,
|
||||
NULL,kIPosixLocaleIID,(void**)&posixConverter);
|
||||
if (NS_SUCCEEDED(result) && posixConverter!=nsnull) {
|
||||
char* lc_all = setlocale(LC_ALL,NULL);
|
||||
char* lc_all = setlocale(LC_ALL,"");
|
||||
char* lang = getenv("LANG");
|
||||
|
||||
if (lc_all!=nsnull) {
|
||||
|
|
|
@ -160,7 +160,7 @@ nsresult nsCollationUnix::GetSortKeyLen(const nsCollationStrength strength,
|
|||
res = mCollation->UnicodeToChar(stringNormalized, &str, mCharset);
|
||||
if (NS_SUCCEEDED(res) && str != NULL) {
|
||||
char *cstr = mLocale.ToNewCString();
|
||||
char *old_locale = setlocale(LC_COLLATE, NULL);
|
||||
char *old_locale = setlocale(LC_COLLATE, "");
|
||||
(void) setlocale(LC_COLLATE, cstr);
|
||||
// call strxfrm to calculate a key length
|
||||
int len = strxfrm(NULL, str, 0) + 1;
|
||||
|
@ -188,7 +188,7 @@ nsresult nsCollationUnix::CreateRawSortKey(const nsCollationStrength strength,
|
|||
res = mCollation->UnicodeToChar(stringNormalized, &str, mCharset);
|
||||
if (NS_SUCCEEDED(res) && str != NULL) {
|
||||
char *cstr = mLocale.ToNewCString();
|
||||
char *old_locale = setlocale(LC_COLLATE, NULL);
|
||||
char *old_locale = setlocale(LC_COLLATE, "");
|
||||
(void) setlocale(LC_COLLATE, cstr);
|
||||
// call strxfrm to generate a key
|
||||
int len = strxfrm((char *) key, str, strlen(str));
|
||||
|
|
|
@ -186,7 +186,7 @@ nsresult nsDateTimeFormatUnix::FormatTMTime(nsILocale* locale,
|
|||
}
|
||||
|
||||
// generate data/time string
|
||||
char *old_locale = setlocale(LC_TIME, NULL);
|
||||
char *old_locale = setlocale(LC_TIME, "");
|
||||
(void) setlocale(LC_TIME, mPlatformLocale);
|
||||
if (PL_strlen(fmtD) && PL_strlen(fmtT)) {
|
||||
PL_strncat(fmtD, " ", NSDATETIME_FORMAT_BUFFER_LEN);
|
||||
|
|
Загрузка…
Ссылка в новой задаче