From 36384ceb64c64b903495cd7bd462676f394f674a Mon Sep 17 00:00:00 2001 From: ydong10 Date: Fri, 10 Aug 2012 01:10:05 +0000 Subject: Refine get default language logic for command "drivers". Signed-off-by: Eric Dong Reviewed-by: Jaben Carsey git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13603 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/UefiShellDriver1CommandsLib/Drivers.c | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c') diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c index 18912e8f07..1f7675b8b5 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c @@ -221,19 +221,17 @@ ShellCommandRunDrivers ( ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle); ShellStatus = SHELL_INVALID_PARAMETER; } else { - Lang = ShellCommandLineGetValue(Package, L"-l"); - if (Lang != NULL) { - Language = AllocateZeroPool(StrSize(Lang)); - AsciiSPrint(Language, StrSize(Lang), "%S", Lang); - } else if (!ShellCommandLineGetFlag(Package, L"-l")){ - ASSERT(Language == NULL); - // Language = AllocateZeroPool(10); - // AsciiSPrint(Language, 10, "en-us"); - } else { - ASSERT(Language == NULL); - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"-l"); - ShellCommandLineFreeVarList (Package); - return (SHELL_INVALID_PARAMETER); + if (ShellCommandLineGetFlag(Package, L"-l")){ + Lang = ShellCommandLineGetValue(Package, L"-l"); + if (Lang != NULL) { + Language = AllocateZeroPool(StrSize(Lang)); + AsciiSPrint(Language, StrSize(Lang), "%S", Lang); + } else { + ASSERT(Language == NULL); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"-l"); + ShellCommandLineFreeVarList (Package); + return (SHELL_INVALID_PARAMETER); + } } if (ShellCommandLineGetFlag(Package, L"-sfo")) { @@ -261,7 +259,7 @@ ShellCommandRunDrivers ( DriverVersion = ReturnDriverVersion(*HandleWalker); DriverConfig = ReturnDriverConfig(*HandleWalker); DriverDiag = ReturnDriverDiag (*HandleWalker); - Lang = GetStringNameFromHandle(*HandleWalker, Language==NULL?"en":Language); + Lang = GetStringNameFromHandle(*HandleWalker, Language); ShellPrintEx( -1, -- cgit v1.2.3