return (EFI_OUT_OF_RESOURCES);\r
}\r
TempWalker = (CHAR16*)Temp;\r
- GetNextParameter(&TempWalker, &FirstParameter, StrSize(CmdLine));\r
-\r
- if (GetOperationType(FirstParameter) == Unknown_Invalid) {\r
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_NOT_FOUND), ShellInfoObject.HiiHandle, FirstParameter);\r
- SetLastError(SHELL_NOT_FOUND);\r
- Status = EFI_NOT_FOUND;\r
+ if (!EFI_ERROR(GetNextParameter(&TempWalker, &FirstParameter, StrSize(CmdLine)))) {\r
+ if (GetOperationType(FirstParameter) == Unknown_Invalid) {\r
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_NOT_FOUND), ShellInfoObject.HiiHandle, FirstParameter);\r
+ SetLastError(SHELL_NOT_FOUND);\r
+ Status = EFI_NOT_FOUND;\r
+ }\r
}\r
}\r
\r
Walker = *CmdLine;\r
while(Walker != NULL && *Walker != CHAR_NULL) {\r
LastWalker = Walker;\r
- GetNextParameter(&Walker, &CurrentParameter, StrSize(*CmdLine));\r
- if (StrStr(CurrentParameter, L"-?") == CurrentParameter) {\r
- LastWalker[0] = L' ';\r
- LastWalker[1] = L' ';\r
- NewCommandLine = AllocateZeroPool(StrSize(L"help ") + StrSize(*CmdLine));\r
- if (NewCommandLine == NULL) {\r
- Status = EFI_OUT_OF_RESOURCES;\r
+ if (!EFI_ERROR(GetNextParameter(&Walker, &CurrentParameter, StrSize(*CmdLine)))) {\r
+ if (StrStr(CurrentParameter, L"-?") == CurrentParameter) {\r
+ LastWalker[0] = L' ';\r
+ LastWalker[1] = L' ';\r
+ NewCommandLine = AllocateZeroPool(StrSize(L"help ") + StrSize(*CmdLine));\r
+ if (NewCommandLine == NULL) {\r
+ Status = EFI_OUT_OF_RESOURCES;\r
+ break;\r
+ }\r
+\r
+ //\r
+ // We know the space is sufficient since we just calculated it.\r
+ //\r
+ StrnCpy(NewCommandLine, L"help ", 5);\r
+ StrnCat(NewCommandLine, *CmdLine, StrLen(*CmdLine));\r
+ SHELL_FREE_NON_NULL(*CmdLine);\r
+ *CmdLine = NewCommandLine;\r
break;\r
}\r
-\r
- //\r
- // We know the space is sufficient since we just calculated it.\r
- //\r
- StrnCpy(NewCommandLine, L"help ", 5);\r
- StrnCat(NewCommandLine, *CmdLine, StrLen(*CmdLine));\r
- SHELL_FREE_NON_NULL(*CmdLine);\r
- *CmdLine = NewCommandLine;\r
- break;\r
}\r
}\r
\r
return (EFI_OUT_OF_RESOURCES);\r
}\r
TempWalker = CleanOriginal;\r
- GetNextParameter(&TempWalker, &FirstParameter, StrSize(CleanOriginal));\r
-\r
- //\r
- // Depending on the first parameter we change the behavior\r
- //\r
- switch (Type = GetOperationType(FirstParameter)) {\r
- case File_Sys_Change:\r
- Status = ChangeMappedDrive (FirstParameter);\r
- break;\r
- case Internal_Command:\r
- case Script_File_Name:\r
- case Efi_Application:\r
- Status = SetupAndRunCommandOrFile(Type, CleanOriginal, FirstParameter, ShellInfoObject.NewShellParametersProtocol);\r
- break;\r
- default:\r
- //\r
- // Whatever was typed, it was invalid.\r
- //\r
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_NOT_FOUND), ShellInfoObject.HiiHandle, FirstParameter);\r
- SetLastError(SHELL_NOT_FOUND);\r
- break;\r
+ if (!EFI_ERROR(GetNextParameter(&TempWalker, &FirstParameter, StrSize(CleanOriginal)))) {\r
+ //\r
+ // Depending on the first parameter we change the behavior\r
+ //\r
+ switch (Type = GetOperationType(FirstParameter)) {\r
+ case File_Sys_Change:\r
+ Status = ChangeMappedDrive (FirstParameter);\r
+ break;\r
+ case Internal_Command:\r
+ case Script_File_Name:\r
+ case Efi_Application:\r
+ Status = SetupAndRunCommandOrFile(Type, CleanOriginal, FirstParameter, ShellInfoObject.NewShellParametersProtocol);\r
+ break;\r
+ default:\r
+ //\r
+ // Whatever was typed, it was invalid.\r
+ //\r
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_NOT_FOUND), ShellInfoObject.HiiHandle, FirstParameter);\r
+ SetLastError(SHELL_NOT_FOUND);\r
+ break;\r
+ }\r
+ } else {\r
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_NOT_FOUND), ShellInfoObject.HiiHandle, FirstParameter);\r
+ SetLastError(SHELL_NOT_FOUND);\r
}\r
\r
SHELL_FREE_NON_NULL(CleanOriginal);\r