From 518c8cdc5c52e8d356075f28354b18a6e5830ca6 Mon Sep 17 00:00:00 2001 From: Jaben Carsey Date: Thu, 12 Dec 2013 17:27:27 +0000 Subject: ShellPkg: Refactor out the searching for pipe characters Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey Reviewed-by: Erik Bjorge git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14969 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Application/Shell/Shell.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'ShellPkg/Application') diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c index 369789a3d7..660e0e5773 100644 --- a/ShellPkg/Application/Shell/Shell.c +++ b/ShellPkg/Application/Shell/Shell.c @@ -71,16 +71,15 @@ STATIC CONST CHAR16 mExecutableExtensions[] = L".NSH;.EFI"; STATIC CONST CHAR16 mStartupScript[] = L"startup.nsh"; /** - Determine if a command line contains a valid split operation + Find a command line contains a split operation @param[in] CmdLine The command line to parse. - @retval TRUE CmdLine has a valid split. - @retval FALSE CmdLine does not have a valid split. + @retval A pointer to the | character in CmdLine or NULL if not present. **/ BOOLEAN EFIAPI -ContainsSplit( +FindSplit( IN CONST CHAR16 *CmdLine ) { @@ -95,6 +94,25 @@ ContainsSplit( } } } + return (TempSpot); +} + +/** + Determine if a command line contains a split operation + + @param[in] CmdLine The command line to parse. + + @retval TRUE CmdLine has a valid split. + @retval FALSE CmdLine does not have a valid split. +**/ +BOOLEAN +EFIAPI +ContainsSplit( + IN CONST CHAR16 *CmdLine + ) +{ + CONST CHAR16 *TempSpot; + TempSpot = FindSplit(CmdLine); return (TempSpot != NULL && *TempSpot != CHAR_NULL); } -- cgit v1.2.3