DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (b6d82b1a6b02)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
# Handle empty string results when calling createLikelySubtagsString() for _uloc_minimizeSubtags().
#
# ICU bug: https://ssl.icu-project.org/trac/ticket/13786

diff --git a/intl/icu/source/common/loclikely.cpp b/intl/icu/source/common/loclikely.cpp
--- a/intl/icu/source/common/loclikely.cpp
+++ b/intl/icu/source/common/loclikely.cpp
@@ -1051,17 +1051,17 @@ _uloc_minimizeSubtags(const char* localeID,
                 0,
                 sink,
                 err);
         }
 
         if(U_FAILURE(*err)) {
             goto error;
         }
-        else if (uprv_strnicmp(
+        else if (!tagBuffer.isEmpty() && uprv_strnicmp(
                     maximizedTagBuffer.data(),
                     tagBuffer.data(),
                     tagBuffer.length()) == 0) {
 
             createTagString(
                         lang,
                         langLength,
                         NULL,
@@ -1096,17 +1096,17 @@ _uloc_minimizeSubtags(const char* localeID,
                 0,
                 sink,
                 err);
         }
 
         if(U_FAILURE(*err)) {
             goto error;
         }
-        else if (uprv_strnicmp(
+        else if (!tagBuffer.isEmpty() && uprv_strnicmp(
                     maximizedTagBuffer.data(),
                     tagBuffer.data(),
                     tagBuffer.length()) == 0) {
 
             createTagString(
                         lang,
                         langLength,
                         script,