]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Enhance op-code EFI_IFR_TO_BOOLEAN to case insensitive.
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 10 Oct 2011 03:17:46 +0000 (03:17 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 10 Oct 2011 03:17:46 +0000 (03:17 +0000)
Signed-off-by: ydong10
Reviewed-by: lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12520 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/SetupBrowserDxe/Expression.c

index cbbb20dc9f3493565d5a80f9865b4e84dad85890..60a23f1822e450778d6305cbe7df6e1612f98639 100644 (file)
@@ -2034,18 +2034,23 @@ EvaluateExpression (
         //\r
         // When converting from a string, if case-insensitive compare\r
         // with "true" is True, then push True. If a case-insensitive compare\r
-        // with "false" is True, then push False.\r
+        // with "false" is True, then push False. Otherwise, push Undefined. \r
         //\r
         StrPtr = GetToken (Value->Value.string, FormSet->HiiHandle);\r
         if (StrPtr == NULL) {\r
           Status = EFI_INVALID_PARAMETER;\r
           goto Done;\r
         }\r
-\r
-        if ((StrCmp (StrPtr, L"true") == 0) || (StrCmp (StrPtr, L"false") == 0)){\r
+        \r
+        IfrStrToUpper (StrPtr);\r
+        if (StrCmp (StrPtr, L"TRUE") == 0){\r
           Value->Value.b = TRUE;\r
-        } else {\r
+        } else if (StrCmp (StrPtr, L"FALSE") == 0) {\r
           Value->Value.b = FALSE;\r
+        } else {\r
+          Status = EFI_INVALID_PARAMETER;\r
+          FreePool (StrPtr);\r
+          goto Done;\r
         }\r
         FreePool (StrPtr);\r
         Value->Type = EFI_IFR_TYPE_BOOLEAN;\r