From 20b415ce31299dc0442621e08539e01e7f912187 Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Wed, 27 Apr 2016 22:14:29 +0000 Subject: [PATCH] ICU-12510 resource data enumeration: do not fail if parents up to root do not have the requested path X-SVN-Rev: 38656 --- icu4c/source/common/uresbund.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/icu4c/source/common/uresbund.cpp b/icu4c/source/common/uresbund.cpp index a14b84a7e9..e62628db46 100644 --- a/icu4c/source/common/uresbund.cpp +++ b/icu4c/source/common/uresbund.cpp @@ -1945,13 +1945,14 @@ void getAllItemsWithFallback( UResourceBundle containerBundle; ures_initStackObject(&containerBundle); const UResourceBundle *rb; + UErrorCode pathErrorCode = U_ZERO_ERROR; // Ignore if parents up to root do not have this path. if (bundle->fResPath == NULL || *bundle->fResPath == 0) { rb = &parentBundle; } else { rb = ures_getByKeyWithFallback(&parentBundle, bundle->fResPath, - &containerBundle, &errorCode); + &containerBundle, &pathErrorCode); } - if (U_SUCCESS(errorCode) && (expectedType == URES_NONE || ures_getType(rb) == expectedType)) { + if (U_SUCCESS(pathErrorCode) && (expectedType == URES_NONE || ures_getType(rb) == expectedType)) { getAllItemsWithFallback(rb, value, sink, arraySink, tableSink, errorCode); } ures_close(&containerBundle);