From nobody Sun May 5 03:52:16 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 1520502712821675.9644846436031; Thu, 8 Mar 2018 01:51:52 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 618C422135D58; Thu, 8 Mar 2018 01:45:32 -0800 (PST) Received: from g2t4619.austin.hp.com (g2t4619.austin.hp.com [15.73.212.82]) (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 7B79821ED1C6E for ; Thu, 8 Mar 2018 00:01:17 -0800 (PST) Received: from ZHANZHEN12.auth.hpicorp.net (zhanzhen12.auth.hpicorp.net [15.45.230.118]) by g2t4619.austin.hp.com (Postfix) with ESMTP id 11E7216B; Thu, 8 Mar 2018 08:07:28 +0000 (UTC) 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=15.73.212.82; helo=g2t4619.austin.hp.com; envelope-from=zheng.zhang1@hp.com; receiver=edk2-devel@lists.01.org From: Zane Zhange To: edk2-devel@lists.01.org Date: Thu, 8 Mar 2018 16:07:27 +0800 Message-Id: <20180308080727.15328-1-zheng.zhang1@hp.com> X-Mailer: git-send-email 2.16.2.windows.1 X-Mailman-Approved-At: Thu, 08 Mar 2018 01:45:30 -0800 Subject: [edk2] [BugFix] ShellPkg: UefiShellLevel1CommandLib: Fix a logic issue about "if /i" 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: , Cc: Jaben Carsey , Ruiyu Ni 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" From: zane66 Hello All, It is my first time to commit my change on github, there might be some erro= rs in this email. But my change actually fixed the issue about "if /i" in U= efi Shell. Thanks. Github Reference URL : https://github.com/zane66/edk2/tree/zane66/master Use this shell script to duplicate this issue: if /i /s "ax" ne "aX" then echo "Not Equal" fi The origin code will echo "Not Equal". This change can fix this issue. Cc: Jaben Carsey Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zane Zhang --- ShellPkg/Library/UefiShellLevel1CommandsLib/If.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c b/ShellPkg/Li= brary/UefiShellLevel1CommandsLib/If.c index 35c5ca6835..94162b2dae 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c @@ -141,7 +141,7 @@ TestOperation ( // // string compare // - if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) > = 0) || (StringCompare(&Compare1, &Compare2) > 0)) { + if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) > = 0) || (!CaseInsensitive && StringCompare(&Compare1, &Compare2) > 0)) { return (TRUE); } } else { @@ -175,7 +175,7 @@ TestOperation ( // // string compare // - if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) < = 0) || (StringCompare(&Compare1, &Compare2) < 0)) { + if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) < = 0) || (!CaseInsensitive && StringCompare(&Compare1, &Compare2) < 0)) { return (TRUE); } } else { @@ -209,7 +209,7 @@ TestOperation ( // // string compare // - if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) = =3D=3D 0) || (StringCompare(&Compare1, &Compare2) =3D=3D 0)) { + if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) = =3D=3D 0) || (!CaseInsensitive && StringCompare(&Compare1, &Compare2) =3D= =3D 0)) { return (TRUE); } } else { @@ -236,7 +236,7 @@ TestOperation ( // // string compare // - if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) != =3D 0) || (StringCompare(&Compare1, &Compare2) !=3D 0)) { + if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) != =3D 0) || (!CaseInsensitive && StringCompare(&Compare1, &Compare2) !=3D 0))= { return (TRUE); } } else { @@ -264,7 +264,7 @@ TestOperation ( // // string compare // - if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) >= =3D 0) || (StringCompare(&Compare1, &Compare2) >=3D 0)) { + if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) >= =3D 0) || (!CaseInsensitive && StringCompare(&Compare1, &Compare2) >=3D 0))= { return (TRUE); } } else { @@ -298,7 +298,7 @@ TestOperation ( // // string compare // - if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) <= =3D 0) || (StringCompare(&Compare1, &Compare2) <=3D 0)) { + if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) <= =3D 0) || (!CaseInsensitive && StringCompare(&Compare1, &Compare2) <=3D 0))= { return (TRUE); } } else { --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel