diff options
author | Eric Dong <eric.dong@intel.com> | 2013-09-05 03:02:14 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-09-05 03:02:14 +0000 |
commit | a71003f2491a26b96b808064d35c8fd01d6422ed (patch) | |
tree | de9861440b48f2907654a7b15ba8805656fbd959 /ShellPkg/Application/Shell | |
parent | c683aa9cd1074135a1d22b11c0ca85631e9a7813 (diff) | |
download | edk2-platforms-a71003f2491a26b96b808064d35c8fd01d6422ed.tar.xz |
Refine the select language logic.
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14629 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Application/Shell')
-rw-r--r-- | ShellPkg/Application/Shell/ShellProtocol.c | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c index e1aadb845d..89132969b6 100644 --- a/ShellPkg/Application/Shell/ShellProtocol.c +++ b/ShellPkg/Application/Shell/ShellProtocol.c @@ -645,8 +645,6 @@ EfiShellGetDeviceName( UINTN LoopVar;
CHAR16 *DeviceNameToReturn;
CHAR8 *Lang;
- CHAR8 *TempChar;
-
UINTN ParentControllerCount;
EFI_HANDLE *ParentControllerBuffer;
UINTN ParentDriverCount;
@@ -703,23 +701,7 @@ EfiShellGetDeviceName( if (EFI_ERROR(Status)) {
continue;
}
- if (Language == NULL) {
- Lang = AllocateZeroPool(AsciiStrSize(CompName2->SupportedLanguages));
- if (Lang == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Lang, CompName2->SupportedLanguages);
- TempChar = AsciiStrStr(Lang, ";");
- if (TempChar != NULL){
- *TempChar = CHAR_NULL;
- }
- } else {
- Lang = AllocateZeroPool(AsciiStrSize(Language));
- if (Lang == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Lang, Language);
- }
+ Lang = GetBestLanguageForDriver(CompName2->SupportedLanguages, Language, FALSE);
Status = CompName2->GetControllerName(CompName2, DeviceHandle, NULL, Lang, &DeviceNameToReturn);
FreePool(Lang);
Lang = NULL;
@@ -762,23 +744,7 @@ EfiShellGetDeviceName( if (EFI_ERROR(Status)) {
continue;
}
- if (Language == NULL) {
- Lang = AllocateZeroPool(AsciiStrSize(CompName2->SupportedLanguages));
- if (Lang == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Lang, CompName2->SupportedLanguages);
- TempChar = AsciiStrStr(Lang, ";");
- if (TempChar != NULL){
- *TempChar = CHAR_NULL;
- }
- } else {
- Lang = AllocateZeroPool(AsciiStrSize(Language));
- if (Lang == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Lang, Language);
- }
+ Lang = GetBestLanguageForDriver(CompName2->SupportedLanguages, Language, FALSE);
Status = CompName2->GetControllerName(CompName2, ParentControllerBuffer[LoopVar], DeviceHandle, Lang, &DeviceNameToReturn);
FreePool(Lang);
Lang = NULL;
|