From: zane66 <[email protected]>

Hello All,


It is my first time to commit my change on github, there might be some errors 
in this email. But my change actually fixed the issue about "if /i" in Uefi 
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 <[email protected]>
Cc: Ruiyu Ni <[email protected]>

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zane Zhang <[email protected]>
---
 ShellPkg/Library/UefiShellLevel1CommandsLib/If.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c 
b/ShellPkg/Library/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) == 0) 
|| (StringCompare(&Compare1, &Compare2) == 0)) {
+      if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) == 0) 
|| (!CaseInsensitive && StringCompare(&Compare1, &Compare2) == 0)) {
         return (TRUE);
       }
     } else {
@@ -236,7 +236,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 {
@@ -264,7 +264,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 {
@@ -298,7 +298,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 {
-- 
2.16.2.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to