]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
ShellPkg SmbiosView: Eliminate trailing " | " in PrintBitsInfo()
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / QueryTable.c
index 282ba584c8c9a1b5f4602673a1f4492129e28030..02d9ab1f57b3d246a18765384148a17bb5fb052f 100644 (file)
@@ -3449,19 +3449,24 @@ PrintBitsInfo (
 \r
   UINTN   Index;\r
   UINT32  Value;\r
-  BOOLEAN NoInfo;\r
+  BOOLEAN FirstInfo;\r
 \r
-  NoInfo  = TRUE;\r
+  FirstInfo = TRUE;\r
   Value   = Bits;\r
   //\r
   // query the table and print information\r
   //\r
   for (Index = 0; Index < Number; Index++) {\r
     if (BIT (Value, Table[Index].Key) != 0) {\r
+      if (!FirstInfo) {\r
+        //\r
+        // If it is not first info, print the separator first.\r
+        //\r
+        Print (L" | ");\r
+      }\r
       Print (Table[Index].Info);\r
-      Print (L" | ");\r
 \r
-      NoInfo = FALSE;\r
+      FirstInfo = FALSE;\r
       //\r
       // clear the bit, for reserved bits test\r
       //\r
@@ -3469,7 +3474,10 @@ PrintBitsInfo (
     }\r
   }\r
 \r
-  if (NoInfo) {\r
+  //\r
+  // There is no any info if FirstInfo is still TRUE.\r
+  //\r
+  if (FirstInfo) {\r
     ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_NO_INFO), gShellDebug1HiiHandle);\r
   }\r
 \r