diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-08-10 01:10:05 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-08-10 01:10:05 +0000 |
commit | 36384ceb64c64b903495cd7bd462676f394f674a (patch) | |
tree | df37b5822feee08f04ffe258869823a342fa181e /ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c | |
parent | 26af9aca92e11b77dbb9cf942d9dae92a71bfbbd (diff) | |
download | edk2-platforms-36384ceb64c64b903495cd7bd462676f394f674a.tar.xz |
Refine get default language logic for command "drivers".
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13603 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c')
-rw-r--r-- | ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c | 26 |
1 files changed, 12 insertions, 14 deletions
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,
|