SHELL_FREE_NON_NULL(OurCommandLine);\r
SHELL_FREE_NON_NULL(NextCommandLine);\r
return (EFI_INVALID_PARAMETER);\r
- } else if (NextCommandLine[0] != CHAR_NULL &&\r
- NextCommandLine[0] == L'a' &&\r
- NextCommandLine[1] == L' '\r
- ){\r
+ } else if (NextCommandLine[0] == L'a' &&\r
+ (NextCommandLine[1] == L' ' || NextCommandLine[1] == CHAR_NULL)\r
+ ){\r
CopyMem(NextCommandLine, NextCommandLine+1, StrSize(NextCommandLine) - sizeof(NextCommandLine[0]));\r
+ while (NextCommandLine[0] == L' ') {\r
+ CopyMem(NextCommandLine, NextCommandLine+1, StrSize(NextCommandLine) - sizeof(NextCommandLine[0]));\r
+ }\r
+ if (NextCommandLine[0] == CHAR_NULL) {\r
+ SHELL_FREE_NON_NULL(OurCommandLine);\r
+ SHELL_FREE_NON_NULL(NextCommandLine);\r
+ return (EFI_INVALID_PARAMETER);\r
+ }\r
Unicode = FALSE;\r
} else {\r
Unicode = TRUE;\r
EFI_STATUS Status;\r
\r
//\r
- // Verify up to the pipe or end character\r
+ // If this was the only item, then get out\r
//\r
- Status = IsValidSplit(CmdLine);\r
- if (EFI_ERROR(Status)) {\r
- return (Status);\r
+ if (!ContainsSplit(CmdLine)) {\r
+ return (EFI_SUCCESS);\r
}\r
\r
//\r
- // If this was the only item, then get out\r
+ // Verify up to the pipe or end character\r
//\r
- if (!ContainsSplit(CmdLine)) {\r
- return (EFI_SUCCESS);\r
+ Status = IsValidSplit(CmdLine);\r
+ if (EFI_ERROR(Status)) {\r
+ return (Status);\r
}\r
\r
//\r
// recurse to verify the next item\r
//\r
TempSpot = FindFirstCharacter(CmdLine, L"|", L'^') + 1;\r
+ if (*TempSpot == L'a' && \r
+ (*(TempSpot + 1) == L' ' || *(TempSpot + 1) == CHAR_NULL)\r
+ ) {\r
+ // If it's an ASCII pipe '|a'\r
+ TempSpot += 1;\r
+ }\r
+ \r
return (VerifySplit(TempSpot));\r
}\r
\r