From 9e9f0be353d4e28ccbca8f84fc8b2ab1bbe31d5c Mon Sep 17 00:00:00 2001 From: Marvin H?user Date: Tue, 5 Nov 2019 21:50:44 +0800 Subject: ShellPkg/CommandLib: Use first found UC for unsupported PlatformLang REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2300 On some firmwares PlatformLang is set to the local language (e.g. ru-RU), however there is no Unicode Collation protocol instance that supports it. As for missing PlatformLang, fall back to the first found instance. Cc: Ray Ni Cc: Zhichao Gao Reviewed-by: Zhichao Gao Signed-off-by: Marvin Haeuser --- ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ShellPkg') diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c index 4c48b65fbc..345808a1ea 100644 --- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c +++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c @@ -107,9 +107,13 @@ CommandInit( // // Without clue provided use the first Unicode Collation2 protocol. + // This may happen when PlatformLang is NULL or when no installed Unicode + // Collation2 protocol instance supports PlatformLang. // - if (PlatformLang == NULL) { + if (gUnicodeCollation == NULL) { gUnicodeCollation = Uc; + } + if (PlatformLang == NULL) { break; } -- cgit v1.2.3