\r
#include "UefiShellLevel1CommandsLib.h"\r
#include <Library/PrintLib.h>\r
+#include <Library/PathLib.h>\r
\r
typedef enum {\r
EndTagOr,\r
/**\r
Extract the next fragment, if there is one.\r
\r
- @param[in,out] Statement The current remaining statement.\r
- @param[in] Fragment The current fragment.\r
+ @param[in, out] Statement The current remaining statement.\r
+ @param[in] Fragment The current fragment.\r
\r
@retval FALSE There is not another fragment.\r
@retval TRUE There is another fragment.\r
CONST CHAR16 *TempLocation;\r
\r
ProfilesString = ShellGetEnvironmentVariable(L"profiles");\r
+ ASSERT(ProfilesString != NULL);\r
TempLocation = StrStr(ProfilesString, String);\r
if ((TempLocation != NULL) && (*(TempLocation-1) == L';') && (*(TempLocation+StrLen(String)) == L';')) {\r
return (TRUE);\r
/**\r
Process an if statement and determine if its is valid or not.\r
\r
- @param[in,out] PassingState Opon entry, the current state. Upon exit, \r
- the new state.\r
- @param[in] StartParameterNumber The number of the first parameter of\r
- this statement.\r
- @param[in] EndParameterNumber The number of the final parameter of\r
- this statement.\r
- @param[in] OperatorToUse The type of termination operator.\r
- @param[in] CaseInsensitive TRUE for case insensitive, FALSE otherwise.\r
- @param[in] ForceStringCompare TRUE for all string based, FALSE otherwise.\r
+ @param[in, out] PassingState Opon entry, the current state. Upon exit, \r
+ the new state.\r
+ @param[in] StartParameterNumber The number of the first parameter of\r
+ this statement.\r
+ @param[in] EndParameterNumber The number of the final parameter of\r
+ this statement.\r
+ @param[in] OperatorToUse The type of termination operator.\r
+ @param[in] CaseInsensitive TRUE for case insensitive, FALSE otherwise.\r
+ @param[in] ForceStringCompare TRUE for all string based, FALSE otherwise.\r
\r
@retval EFI_INVALID_PARAMETER A parameter was invalid.\r
@retval EFI_SUCCESS The operation was successful. \r
OUT END_TAG_TYPE *EndTag\r
)\r
{\r
- CHAR16 *Buffer;\r
- UINTN BufferSize;\r
-\r
*EndTag = EndTagMax;\r
\r
- for(Buffer = NULL, BufferSize = 0\r
+ for(\r
; ParameterNumber < gEfiShellParametersProtocol->Argc\r
; ParameterNumber++\r
) {\r
//\r
CommandName = NULL;\r
CommandName = StrnCatGrow(&CommandName, NULL, CommandNode->Cl, 0);\r
+ if (CommandName == NULL) {\r
+ continue;\r
+ }\r
CommandWalker = CommandName;\r
while (CommandWalker[0] == L' ') {\r
CommandWalker++;\r