/** @file\r
This is THE shell (application)\r
\r
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
Copyright (c) 2013, Hewlett-Packard Development Company, L.P.\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
if (!EFI_ERROR (Status)) {\r
CmdLine[BufferSize / sizeof (CHAR16)] = CHAR_NULL;\r
Status = RunCommand(CmdLine);\r
- }\r
+ }\r
\r
//\r
// Done with this command\r
return (Unknown_Invalid);\r
}\r
\r
+/**\r
+ Determine if the first item in a command line is valid.\r
+\r
+ @param[in] CmdLine The command line to parse.\r
+\r
+ @retval EFI_SUCCESS The item is valid.\r
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.\r
+ @retval EFI_NOT_FOUND The operation type is unknown or invalid.\r
+**/\r
EFI_STATUS \r
EFIAPI\r
IsValidSplit(\r
while(!ShellFileHandleEof(Handle)) {\r
CommandLine = ShellFileHandleReturnLine(Handle, &Ascii);\r
LineCount++;\r
- if (CommandLine == NULL || StrLen(CommandLine) == 0) {\r
+ if (CommandLine == NULL || StrLen(CommandLine) == 0 || CommandLine[0] == '#') {\r
+ SHELL_FREE_NON_NULL(CommandLine);\r
continue;\r
}\r
NewScriptFile->CurrentCommand = AllocateZeroPool(sizeof(SCRIPT_COMMAND_LIST));\r
if (NewScriptFile->CurrentCommand == NULL) {\r
+ SHELL_FREE_NON_NULL(CommandLine);\r
DeleteScriptFileStruct(NewScriptFile);\r
return (EFI_OUT_OF_RESOURCES);\r
}\r