From e2aece84bf69f5fd366a746a51b6676b449bc07b Mon Sep 17 00:00:00 2001 From: "nhotta%netscape.com" Date: Thu, 18 Nov 1999 03:28:35 +0000 Subject: [PATCH] Change to pass an empty string to setlocale instead of NULL (which is illegal in Unix unlike windows). Bug 18338, r=tao. --- intl/locale/src/nsLocaleService.cpp | 2 +- intl/locale/src/unix/nsCollationUnix.cpp | 4 ++-- intl/locale/src/unix/nsDateTimeFormatUnix.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/intl/locale/src/nsLocaleService.cpp b/intl/locale/src/nsLocaleService.cpp index 258bf09cc9c..896bd808083 100644 --- a/intl/locale/src/nsLocaleService.cpp +++ b/intl/locale/src/nsLocaleService.cpp @@ -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) { diff --git a/intl/locale/src/unix/nsCollationUnix.cpp b/intl/locale/src/unix/nsCollationUnix.cpp index 08cf15d2c46..bacd2e6806f 100644 --- a/intl/locale/src/unix/nsCollationUnix.cpp +++ b/intl/locale/src/unix/nsCollationUnix.cpp @@ -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)); diff --git a/intl/locale/src/unix/nsDateTimeFormatUnix.cpp b/intl/locale/src/unix/nsDateTimeFormatUnix.cpp index 6d330c7f318..3726c37d1cb 100644 --- a/intl/locale/src/unix/nsDateTimeFormatUnix.cpp +++ b/intl/locale/src/unix/nsDateTimeFormatUnix.cpp @@ -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);