diff options
author | Jaben Carsey <jaben.carsey@intel.com> | 2013-12-17 21:40:41 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-12-17 21:40:41 +0000 |
commit | c81863953f2aca16b2347e7e9977a06fcd1f13aa (patch) | |
tree | f685c1a904c6420d163f266e71ba6f96a2bf1d04 | |
parent | 06f1982a6498731d9ef96a16b3fcd5937f317bd8 (diff) | |
download | edk2-platforms-c81863953f2aca16b2347e7e9977a06fcd1f13aa.tar.xz |
ShellPkg: Fix "for" command statement initialization.
The shell was failing to correctly parse up to the space only for “run (1 3)” and also losing the space for “in ” a b” c” for loop initialization. This fixes for initialization to be correct.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14997 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | ShellPkg/Library/UefiShellLevel1CommandsLib/For.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c index f0c4a23b24..46182f7141 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c @@ -270,7 +270,7 @@ ReturnUintn( {
UINT64 RetVal;
- if (!EFI_ERROR(ShellConvertStringToUint64(String, &RetVal, FALSE, FALSE))) {
+ if (!EFI_ERROR(ShellConvertStringToUint64(String, &RetVal, FALSE, TRUE))) {
return ((UINTN)RetVal);
}
return ((UINTN)(-1));
@@ -370,11 +370,7 @@ ShellCommandRunFor ( gEfiShellParametersProtocol->Argv[2]) == 0) {
for (LoopVar = 0x3 ; LoopVar < gEfiShellParametersProtocol->Argc ; LoopVar++) {
ASSERT((ArgSet == NULL && ArgSize == 0) || (ArgSet != NULL));
- if (ArgSet == NULL) {
- // ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L"\"", 0);
- } else {
- ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L" \"", 0);
- }
+ ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L" \"", 0);
if (StrStr(gEfiShellParametersProtocol->Argv[LoopVar], L"*") != NULL
||StrStr(gEfiShellParametersProtocol->Argv[LoopVar], L"?") != NULL
||StrStr(gEfiShellParametersProtocol->Argv[LoopVar], L"[") != NULL
|