summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaben Carsey <Jaben.carsey@intel.com>2014-05-28 17:31:22 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2014-05-28 17:31:22 +0000
commitf747c71e301c7cf710d6511fbcc86a7ae6d475fa (patch)
tree0301815f61dccd40c488dedc50cb5d46bb7afe98
parent0c41d28e598356f083c308f359d435e63a6e0ef9 (diff)
downloadedk2-platforms-f747c71e301c7cf710d6511fbcc86a7ae6d475fa.tar.xz
ShellPkg: fix display for map command with filtering
This patch correctly displays map information when a filter was applied such as “map fs*” or “map f*”, including the use of “-c” to display the consist names first in this situation. It also moves a statement from both clauses of an “if/else” to above the “if” statement for efficiency. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <Jaben.carsey@intel.com> Reviewed-by: Tapan Shah <tapandshah@hp.com> Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15548 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
index 9e33286c90..4865d0e7a1 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
@@ -1,7 +1,7 @@
/** @file
Main file for map shell level 2 command.
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, 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
@@ -345,6 +345,7 @@ MappingListHasType(
FreePool(NewSpecific);
}
if ( Consist
+ && !Specific
&& (SearchList(MapList, L"HD*", NULL, TRUE, TRUE, L";")
||SearchList(MapList, L"CD*", NULL, TRUE, TRUE, L";")
||SearchList(MapList, L"F*", NULL, TRUE, TRUE, L";")
@@ -353,6 +354,7 @@ MappingListHasType(
}
if ( Normal
+ && !Specific
&& (SearchList(MapList, L"FS", NULL, FALSE, TRUE, L";")
||SearchList(MapList, L"BLK", NULL, FALSE, TRUE, L";"))){
return (TRUE);
@@ -416,7 +418,11 @@ PerformSingleMappingDisplay(
return EFI_NOT_FOUND;
}
- if (Normal) {
+ if (Normal || !Consist) {
+ //
+ // need the Normal here since people can use both on command line. otherwise unused.
+ //
+
//
// Allocate a name
//
@@ -434,7 +440,7 @@ PerformSingleMappingDisplay(
if (TempSpot != NULL) {
*TempSpot = CHAR_NULL;
}
- } else if (Consist) {
+ } else {
CurrentName = NULL;
//
@@ -485,16 +491,10 @@ PerformSingleMappingDisplay(
Alias[StrLen(Alias)-1] = CHAR_NULL;
}
}
- } else {
- CurrentName = NULL;
- CurrentName = StrnCatGrow(&CurrentName, 0, L"", 0);
- if (CurrentName == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
}
DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);
+ TempLen = StrLen(CurrentName);
if (!SFO) {
- TempLen = StrLen(CurrentName);
ShellPrintHiiEx (
-1,
-1,
@@ -528,7 +528,6 @@ PerformSingleMappingDisplay(
SHELL_FREE_NON_NULL(MediaType);
}
} else {
- TempLen = StrLen(CurrentName);
ShellPrintHiiEx (
-1,
-1,