]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Update the ‘for’ command to check number length correctly with trailing...
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 17 Nov 2011 21:38:20 +0000 (21:38 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 17 Nov 2011 21:38:20 +0000 (21:38 +0000)
This fix corrects the logic that checks number length such that is functions correctly without a trailing space.

Signed-off-by: jcarsey
Reviewed-by: geekboy15a
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12736 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Library/UefiShellLevel1CommandsLib/For.c

index 121ac50918f97cdb73357f35e6d01b11ac5a8b7b..7d91d2348f73e94cc16175583d2f4ab308a18c73 100644 (file)
@@ -42,7 +42,7 @@ ShellIsValidForNumber (
   }\r
 \r
   if (StrLen(Number) >= 7) {\r
   }\r
 \r
   if (StrLen(Number) >= 7) {\r
-    if (StrStr(Number, L" ") != NULL && (StrStr(Number, L" ") - Number) >= 7) {\r
+    if ((StrStr(Number, L" ") == NULL) || (((StrStr(Number, L" ") != NULL) && (StrStr(Number, L" ") - Number) >= 7))) {\r
       return (FALSE);\r
     }\r
   }\r
       return (FALSE);\r
     }\r
   }\r