gecko-dev/intl/icu-patches/bug-1792775-ICU-22198.diff
André Bargull 7a825e75ec Bug 1792775 - Part 1: Update or remove ICU patches. r=platform-i18n-reviewers,dminor
Remove the patch for bug 1766220 because the local patch was just a backport
from the ICU development branch.

And update the local patches for Sorbian and WASI integration to apply cleanly
on ICU 72.

Differential Revision: https://phabricator.services.mozilla.com/D160179
2022-11-23 17:56:03 +00:00

20 lines
821 B
Diff

# https://github.com/unicode-org/icu/pull/2248
# https://github.com/unicode-org/icu/pull/2248.diff
#
# ICU bug: https://unicode-org.atlassian.net/browse/ICU-22198
diff --git a/intl/icu/source/common/uresbund.cpp b/intl/icu/source/common/uresbund.cpp
index 17c0177a05c..81fb90e1384 100644
--- a/intl/icu/source/common/uresbund.cpp
+++ b/intl/icu/source/common/uresbund.cpp
@@ -202,7 +202,8 @@ typedef enum UResOpenType UResOpenType;
*/
static bool getParentLocaleID(char *name, const char *origName, UResOpenType openType) {
// early out if the locale ID has a variant code or ends with _
- if (name[uprv_strlen(name) - 1] == '_' || hasVariant(name)) {
+ size_t nameLen = uprv_strlen(name);
+ if (!nameLen || name[nameLen - 1] == '_' || hasVariant(name)) {
return chopLocale(name);
}