X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/73c04bcfe1096173b00431f0cdc742894b15eef0..b25be06635768807f8f693286fa73bb2297bb06c:/icuSources/common/locutil.cpp?ds=sidebyside diff --git a/icuSources/common/locutil.cpp b/icuSources/common/locutil.cpp index 777403d7..57c305f6 100644 --- a/icuSources/common/locutil.cpp +++ b/icuSources/common/locutil.cpp @@ -1,9 +1,7 @@ /** ******************************************************************************* - * Copyright (C) 2002-2005, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * + * Copyright (C) 2002-2010, International Business Machines Corporation and + * others. All Rights Reserved. ******************************************************************************* */ #include "unicode/utypes.h" @@ -20,7 +18,7 @@ #include "umutex.h" // see LocaleUtility::getAvailableLocaleNames -static Hashtable * LocaleUtility_cache = NULL; +static U_NAMESPACE_QUALIFIER Hashtable * LocaleUtility_cache = NULL; #define UNDERSCORE_CHAR ((UChar)0x005f) #define AT_SIGN_CHAR ((UChar)64) @@ -227,9 +225,9 @@ LocaleUtility::getAvailableLocaleNames(const UnicodeString& bundleID) if (htp == NULL) { htp = new Hashtable(status); if (htp && U_SUCCESS(status)) { - CharString cbundleID(bundleID); - const char* path = (const char*) cbundleID; - if (*path == 0) path = NULL; // empty string => NULL + CharString cbundleID; + cbundleID.appendInvariantChars(bundleID, status); + const char* path = cbundleID.isEmpty() ? NULL : cbundleID.data(); UEnumeration *uenum = ures_openAvailableLocales(path, &status); for (;;) { const UChar* id = uenum_unext(uenum, NULL, &status);