summaryrefslogtreecommitdiffstats
path: root/minui
diff options
context:
space:
mode:
authorxunchang <xunchang@google.com>2019-04-23 00:32:17 +0200
committerxunchang <xunchang@google.com>2019-04-23 00:32:17 +0200
commit34723087fe79349607e3128707f0739e5e230a77 (patch)
tree37b1d9358f035930bba811c9b50e41fa8d3c9a50 /minui
parentFall back to en-US if localized bitmap is missing for a locale (diff)
downloadandroid_bootable_recovery-34723087fe79349607e3128707f0739e5e230a77.tar
android_bootable_recovery-34723087fe79349607e3128707f0739e5e230a77.tar.gz
android_bootable_recovery-34723087fe79349607e3128707f0739e5e230a77.tar.bz2
android_bootable_recovery-34723087fe79349607e3128707f0739e5e230a77.tar.lz
android_bootable_recovery-34723087fe79349607e3128707f0739e5e230a77.tar.xz
android_bootable_recovery-34723087fe79349607e3128707f0739e5e230a77.tar.zst
android_bootable_recovery-34723087fe79349607e3128707f0739e5e230a77.zip
Diffstat (limited to 'minui')
-rw-r--r--minui/resources.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/minui/resources.cpp b/minui/resources.cpp
index 53c932bff..00d36d5fb 100644
--- a/minui/resources.cpp
+++ b/minui/resources.cpp
@@ -347,6 +347,10 @@ bool matches_locale(const std::string& prefix, const std::string& locale) {
// match the locale string without the {script} section.
// For instance, prefix == "en" matches locale == "en-US", prefix == "sr-Latn" matches locale
// == "sr-Latn-BA", and prefix == "zh-CN" matches locale == "zh-Hans-CN".
+ if (prefix.empty()) {
+ return false;
+ }
+
if (android::base::StartsWith(locale, prefix)) {
return true;
}