summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-11-17 21:38:20 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-11-17 21:38:20 +0000
commit2d3759d8b5f48c487a9ea749ae2e453a58c36f47 (patch)
treee7f7df9538679d367b5823876679a4019a3bdfb7 /ShellPkg
parentf6ec0c771a4a1a9b19835345eca7d06510f08fa8 (diff)
downloadedk2-platforms-2d3759d8b5f48c487a9ea749ae2e453a58c36f47.tar.xz
ShellPkg: Update the ‘for’ command to check number length correctly with trailing spaces.
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
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/For.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c
index 121ac50918..7d91d2348f 100644
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c
+++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c
@@ -42,7 +42,7 @@ ShellIsValidForNumber (
}
if (StrLen(Number) >= 7) {
- if (StrStr(Number, L" ") != NULL && (StrStr(Number, L" ") - Number) >= 7) {
+ if ((StrStr(Number, L" ") == NULL) || (((StrStr(Number, L" ") != NULL) && (StrStr(Number, L" ") - Number) >= 7))) {
return (FALSE);
}
}