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/Library/UefiShellDriver1CommandsLib/DrvDiag.c | |
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/Library/UefiShellDriver1CommandsLib/DrvDiag.c')
-rw-r--r-- | ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c index 986dc3a056..c3c1b575e8 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c @@ -1,7 +1,7 @@ /** @file
Main file for DrvDiag shell Driver1 function.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -71,7 +71,6 @@ DoDiagnostics ( UINTN HandleIndex1;
UINTN HandleIndex2;
CHAR8 *Language;
- CHAR8 *TempChar;
BOOLEAN Found;
if ((ChildHandle != NULL && AllChilds) || (Mode >= TestModeMax)){
@@ -180,24 +179,8 @@ DoDiagnostics ( gImageHandle,
NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (!EFI_ERROR(Status)) {
- if (Lang == NULL) {
- Language = AllocateZeroPool(AsciiStrSize(DriverDiagnostics2->SupportedLanguages));
- if (Language == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Language, DriverDiagnostics2->SupportedLanguages);
- TempChar = AsciiStrStr(Language, ";");
- if (TempChar != NULL){
- *TempChar = CHAR_NULL;
- }
- } else {
- Language = AllocateZeroPool(AsciiStrSize(Lang));
- if (Language == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Language, Lang);
- }
+ if (!EFI_ERROR(Status) && (DriverDiagnostics2 != NULL)) {
+ Language = GetBestLanguageForDriver(DriverDiagnostics2->SupportedLanguages, Lang, FALSE);
Found = TRUE;
Status = DriverDiagnostics2->RunDiagnostics(
DriverDiagnostics2,
@@ -220,23 +203,7 @@ DoDiagnostics ( NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (!EFI_ERROR(Status)) {
- if (Lang == NULL) {
- Language = AllocateZeroPool(AsciiStrSize(DriverDiagnostics2->SupportedLanguages));
- if (Language == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Language, DriverDiagnostics2->SupportedLanguages);
- TempChar = AsciiStrStr(Language, ";");
- if (TempChar != NULL){
- *TempChar = CHAR_NULL;
- }
- } else {
- Language = AllocateZeroPool(AsciiStrSize(Lang));
- if (Language == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Language, Lang);
- }
+ Language = GetBestLanguageForDriver(DriverDiagnostics->SupportedLanguages, Lang, FALSE);
Status = DriverDiagnostics->RunDiagnostics(
DriverDiagnostics,
ControllerHandleList[ControllerHandleListLoop],
|