From nobody Mon Apr 29 16:15:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1519883796033185.3719246557198; Wed, 28 Feb 2018 21:56:36 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8ABB222423835; Wed, 28 Feb 2018 21:50:26 -0800 (PST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 3336C22423834 for ; Wed, 28 Feb 2018 21:50:23 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2018 21:56:31 -0800 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by FMSMGA003.fm.intel.com with ESMTP; 28 Feb 2018 21:56:30 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,407,1515484800"; d="scan'208";a="30601468" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Thu, 1 Mar 2018 13:56:27 +0800 Message-Id: <1519883787-11988-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [Patch] BaseTools: Fix the bug for display incorrect *M flag in report X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The root cause is the byte array value in the driver Pcd, some bytes have additional space character, while the value in DSC file doesn't have this space, it cause the string compare return false, so we remove the extra space. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/Common/String.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/BaseTools/Source/Python/Common/String.py b/BaseTools/Source/Py= thon/Common/String.py index 5e50bef..696be4c 100644 --- a/BaseTools/Source/Python/Common/String.py +++ b/BaseTools/Source/Python/Common/String.py @@ -815,38 +815,38 @@ def GetHelpTextList(HelpTextClassList): return List =20 def StringToArray(String): if isinstance(String, unicode): if len(unicode) =3D=3D 0: - return "{0x00, 0x00}" - return "{%s, 0x00, 0x00}" % ", ".join(["0x%02x, 0x00" % ord(C) for= C in String]) + return "{0x00,0x00}" + return "{%s,0x00,0x00}" % ",".join(["0x%02x,0x00" % ord(C) for C i= n String]) elif String.startswith('L"'): if String =3D=3D "L\"\"": - return "{0x00, 0x00}" + return "{0x00,0x00}" else: - return "{%s, 0x00, 0x00}" % ", ".join(["0x%02x, 0x00" % ord(C)= for C in String[2:-1]]) + return "{%s,0x00,0x00}" % ",".join(["0x%02x,0x00" % ord(C) for= C in String[2:-1]]) elif String.startswith('"'): if String =3D=3D "\"\"": return "{0x00,0x00}" else: StringLen =3D len(String[1:-1]) if StringLen % 2: - return "{%s, 0x00}" % ", ".join(["0x%02x" % ord(C) for C i= n String[1:-1]]) + return "{%s,0x00}" % ",".join(["0x%02x" % ord(C) for C in = String[1:-1]]) else: - return "{%s, 0x00,0x00}" % ", ".join(["0x%02x" % ord(C) fo= r C in String[1:-1]]) + return "{%s,0x00,0x00}" % ",".join(["0x%02x" % ord(C) for = C in String[1:-1]]) elif String.startswith('{'): StringLen =3D len(String.split(",")) if StringLen % 2: - return "{%s, 0x00}" % ", ".join([ C for C in String[1:-1].spli= t(',')]) + return "{%s,0x00}" % ",".join([ C.strip() for C in String[1:-1= ].split(',')]) else: - return "{%s}" % ", ".join([ C for C in String[1:-1].split(',')= ]) + return "{%s}" % ",".join([ C.strip() for C in String[1:-1].spl= it(',')]) =20 else: if len(String.split()) % 2: - return '{%s, 0}' % ', '.join(String.split()) + return '{%s,0}' % ','.join(String.split()) else: - return '{%s, 0,0}' % ', '.join(String.split()) + return '{%s,0,0}' % ','.join(String.split()) =20 def StringArrayLength(String): if isinstance(String, unicode): return (len(String) + 1) * 2 + 1; elif String.startswith('L"'): --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel