summaryrefslogtreecommitdiff
path: root/ShellPkg/Application/Shell
diff options
context:
space:
mode:
authorJaben Carsey <jaben.carsey@intel.com>2013-12-12 17:27:27 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2013-12-12 17:27:27 +0000
commit518c8cdc5c52e8d356075f28354b18a6e5830ca6 (patch)
tree2f7e45b1f60cd87c099be4d3477797aa5aef1fd1 /ShellPkg/Application/Shell
parentece77e4047c36ddd177949e81d548bda244ea8a7 (diff)
downloadedk2-platforms-518c8cdc5c52e8d356075f28354b18a6e5830ca6.tar.xz
ShellPkg: Refactor out the searching for pipe characters
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14969 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Application/Shell')
-rw-r--r--ShellPkg/Application/Shell/Shell.c26
1 files changed, 22 insertions, 4 deletions
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);
}