From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5E6D981F81 for ; Thu, 9 Feb 2017 01:22:53 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP; 09 Feb 2017 01:22:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,349,1484035200"; d="scan'208";a="63002934" Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.9.22]) by fmsmga005.fm.intel.com with ESMTP; 09 Feb 2017 01:22:52 -0800 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Ruiyu Ni , Jaben Carsey Date: Thu, 9 Feb 2017 17:22:49 +0800 Message-Id: <1486632169-43240-1-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [PATCH] ShellPkg SmbiosView: Eliminate trailing " | " in PrintBitsInfo() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2017 09:22:53 -0000 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 Cc: Jaben Carsey Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng --- .../UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c index 282ba584c8c9..02d9ab1f57b3 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); } -- 2.7.0.windows.1