From 85344843148e6fcc96029aa9b23e321badfd67a2 Mon Sep 17 00:00:00 2001 From: Kacper Kasper Date: Wed, 17 Mar 2021 00:06:41 +0100 Subject: [PATCH] Fix MutableLocaleRoster::LoadCatalog logic * It should always try loading parent language. Change-Id: I3af14beef70a41242d09b11f09abf749ac92e588 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3802 Reviewed-by: Adrien Destugues --- src/kits/locale/MutableLocaleRoster.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/kits/locale/MutableLocaleRoster.cpp b/src/kits/locale/MutableLocaleRoster.cpp index 30a753db9d..dd4eb90c4e 100644 --- a/src/kits/locale/MutableLocaleRoster.cpp +++ b/src/kits/locale/MutableLocaleRoster.cpp @@ -289,17 +289,17 @@ MutableLocaleRoster::LoadCatalog(const char* signature, for (int32 l = 0; languages.FindString("language", l, &lang) == B_OK; ++l) { catalog = new (std::nothrow) BPrivate::DefaultCatalog(NULL, signature, lang); - if (catalog == NULL) - continue; - if (catalog->InitCheck() != B_OK - || catalog->ReadFromStandardLocations() != B_OK) { - delete catalog; - continue; + if (catalog != NULL) { + if (catalog->InitCheck() != B_OK + || catalog->ReadFromStandardLocations() != B_OK) { + delete catalog; + catalog = NULL; + } else { + defaultCatalogInfo->fLoadedCatalogs.AddItem(catalog); + } } - defaultCatalogInfo->fLoadedCatalogs.AddItem(catalog); - // Chain-load catalogs for languages that depend on // other languages. // The current implementation uses the filename in order to