MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / VerifySplit

Function VerifySplit

ShellPkg/Application/Shell/Shell.c:2116–2151  ·  view source on GitHub ↗

Determine if a command line contains with a split contains only valid commands. @param[in] CmdLine The command line to parse. @retval EFI_SUCCESS CmdLine has only valid commands, application, or has no split. @retval EFI_ABORTED CmdLine has at least one invalid command or application. **/

Source from the content-addressed store, hash-verified

2114 @retval EFI_ABORTED CmdLine has at least one invalid command or application.
2115**/
2116EFI_STATUS
2117VerifySplit(
2118 IN CONST CHAR16 *CmdLine
2119 )
2120{
2121 CONST CHAR16 *TempSpot;
2122 EFI_STATUS Status;
2123
2124 //
2125 // If this was the only item, then get out
2126 //
2127 if (!ContainsSplit(CmdLine)) {
2128 return (EFI_SUCCESS);
2129 }
2130
2131 //
2132 // Verify up to the pipe or end character
2133 //
2134 Status = IsValidSplit(CmdLine);
2135 if (EFI_ERROR(Status)) {
2136 return (Status);
2137 }
2138
2139 //
2140 // recurse to verify the next item
2141 //
2142 TempSpot = FindFirstCharacter(CmdLine, L"|", L'^') + 1;
2143 if (*TempSpot == L'a' &&
2144 (*(TempSpot + 1) == L' ' || *(TempSpot + 1) == CHAR_NULL)
2145 ) {
2146 // If it's an ASCII pipe '|a'
2147 TempSpot += 1;
2148 }
2149
2150 return (VerifySplit(TempSpot));
2151}
2152
2153/**
2154 Process a split based operation.

Callers 1

Calls 3

ContainsSplitFunction · 0.85
IsValidSplitFunction · 0.85
FindFirstCharacterFunction · 0.85

Tested by

no test coverage detected