summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2017-01-18 16:53:33 +0800
committerStar Zeng <star.zeng@intel.com>2017-02-10 16:18:13 +0800
commitd4c109da73db88713d0a3a274923cbe4316705ab (patch)
treec6a8edd785804eb6c4be576e422d0df7371864ea /ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
parent4b5d69d3020841d624ae7c4bf886002b6dbcc654 (diff)
downloadedk2-d4c109da73db88713d0a3a274923cbe4316705ab.tar.gz
edk2-d4c109da73db88713d0a3a274923cbe4316705ab.tar.bz2
edk2-d4c109da73db88713d0a3a274923cbe4316705ab.zip
ShellPkg SmbiosView: Eliminate trailing " | " in PrintBitsInfo()
Current PrintBitsInfo() will always print an additional trailing " | " for the bit flags, for example, Base Board Feature Flags: Hosting board | Replaceable | Th patch is to eliminate trailing " | " in PrintBitsInfo(), then the output will be like below Base Board Feature Flags: Hosting board | Replaceable Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c')
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
index 282ba584c8..02d9ab1f57 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
@@ -3449,19 +3449,24 @@ PrintBitsInfo (
UINTN Index;
UINT32 Value;
- BOOLEAN NoInfo;
+ BOOLEAN FirstInfo;
- NoInfo = TRUE;
+ FirstInfo = TRUE;
Value = Bits;
//
// query the table and print information
//
for (Index = 0; Index < Number; Index++) {
if (BIT (Value, Table[Index].Key) != 0) {
+ if (!FirstInfo) {
+ //
+ // If it is not first info, print the separator first.
+ //
+ Print (L" | ");
+ }
Print (Table[Index].Info);
- Print (L" | ");
- NoInfo = FALSE;
+ FirstInfo = FALSE;
//
// clear the bit, for reserved bits test
//
@@ -3469,7 +3474,10 @@ PrintBitsInfo (
}
}
- if (NoInfo) {
+ //
+ // There is no any info if FirstInfo is still TRUE.
+ //
+ if (FirstInfo) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_NO_INFO), gShellDebug1HiiHandle);
}