From 95d413e0c0c620da20806a58931912f714cf0da9 Mon Sep 17 00:00:00 2001 From: Deborah Goldsmith Date: Wed, 1 Jun 2005 17:43:33 +0000 Subject: [PATCH] ICU-4239 return proper warning from ucurr_getName X-SVN-Rev: 17766 --- icu4c/source/i18n/ucurr.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/icu4c/source/i18n/ucurr.cpp b/icu4c/source/i18n/ucurr.cpp index 279acb9c1c8..858040944ca 100644 --- a/icu4c/source/i18n/ucurr.cpp +++ b/icu4c/source/i18n/ucurr.cpp @@ -490,6 +490,10 @@ ucurr_getName(const UChar* currency, // If that fails (because we are already at root) then exit. if (U_SUCCESS(ec2) || !fallback(loc)) { break; + } else if (strlen(loc) == 0) { + *ec = U_USING_DEFAULT_WARNING; + } else if (*ec != U_USING_DEFAULT_WARNING) { + *ec = U_USING_FALLBACK_WARNING; } } @@ -512,6 +516,7 @@ ucurr_getName(const UChar* currency, // If we fail to find a match, use the ISO 4217 code *len = u_strlen(currency); // Should == ISO_COUNTRY_CODE_LENGTH, but maybe not...? + *ec = U_USING_DEFAULT_WARNING; return currency; }