summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-10 03:17:46 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-10 03:17:46 +0000
commit39099cbdcf8584a0ad3259eb3fdf330439679948 (patch)
tree426e4dce0e28742a69b02e8ec40734bac0d2856f /MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
parentbefbc4f3fbfd3d5825fdc72fcadd4bbc85a8f8a0 (diff)
downloadedk2-39099cbdcf8584a0ad3259eb3fdf330439679948.tar.gz
edk2-39099cbdcf8584a0ad3259eb3fdf330439679948.tar.bz2
edk2-39099cbdcf8584a0ad3259eb3fdf330439679948.zip
Enhance op-code EFI_IFR_TO_BOOLEAN to case insensitive.
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
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Expression.c')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Expression.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
index cbbb20dc9f..60a23f1822 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
@@ -2034,18 +2034,23 @@ EvaluateExpression (
//
// When converting from a string, if case-insensitive compare
// with "true" is True, then push True. If a case-insensitive compare
- // with "false" is True, then push False.
+ // with "false" is True, then push False. Otherwise, push Undefined.
//
StrPtr = GetToken (Value->Value.string, FormSet->HiiHandle);
if (StrPtr == NULL) {
Status = EFI_INVALID_PARAMETER;
goto Done;
}
-
- if ((StrCmp (StrPtr, L"true") == 0) || (StrCmp (StrPtr, L"false") == 0)){
+
+ IfrStrToUpper (StrPtr);
+ if (StrCmp (StrPtr, L"TRUE") == 0){
Value->Value.b = TRUE;
- } else {
+ } else if (StrCmp (StrPtr, L"FALSE") == 0) {
Value->Value.b = FALSE;
+ } else {
+ Status = EFI_INVALID_PARAMETER;
+ FreePool (StrPtr);
+ goto Done;
}
FreePool (StrPtr);
Value->Type = EFI_IFR_TYPE_BOOLEAN;