]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg/CommandLib: Use first found UC for unsupported PlatformLang
authorMarvin H?user <mhaeuser@outlook.de>
Tue, 5 Nov 2019 13:50:44 +0000 (21:50 +0800)
committerLiming Gao <liming.gao@intel.com>
Fri, 8 Nov 2019 00:29:58 +0000 (08:29 +0800)
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 <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Marvin Haeuser <mhaeuser@outlook.de>
ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c

index 4c48b65fbc1de21f5f200ab06ca5c56714a6a78c..345808a1eac633aae01edb0a7dfbdb83f89777e0 100644 (file)
@@ -107,9 +107,13 @@ CommandInit(
 \r
       //\r
       // Without clue provided use the first Unicode Collation2 protocol.\r
+      // This may happen when PlatformLang is NULL or when no installed Unicode\r
+      // Collation2 protocol instance supports PlatformLang.\r
       //\r
-      if (PlatformLang == NULL) {\r
+      if (gUnicodeCollation == NULL) {\r
         gUnicodeCollation = Uc;\r
+      }\r
+      if (PlatformLang == NULL) {\r
         break;\r
       }\r
 \r