]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Refactor out the searching for pipe characters
authorJaben Carsey <jaben.carsey@intel.com>
Thu, 12 Dec 2013 17:27:27 +0000 (17:27 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 12 Dec 2013 17:27:27 +0000 (17:27 +0000)
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

ShellPkg/Application/Shell/Shell.c

index 369789a3d73541167fce8a660c114ecdcb9dbc95..660e0e5773c0a4891978605ddc117069a7900afd 100644 (file)
@@ -71,16 +71,15 @@ STATIC CONST CHAR16 mExecutableExtensions[] = L".NSH;.EFI";
 STATIC CONST CHAR16 mStartupScript[]        = L"startup.nsh";\r
 \r
 /**\r
-  Determine if a command line contains a valid split operation\r
+  Find a command line contains a split operation\r
 \r
   @param[in] CmdLine      The command line to parse.\r
 \r
-  @retval TRUE            CmdLine has a valid split.\r
-  @retval FALSE           CmdLine does not have a valid split.\r
+  @retval                 A pointer to the | character in CmdLine or NULL if not present.\r
 **/\r
 BOOLEAN\r
 EFIAPI\r
-ContainsSplit(\r
+FindSplit(\r
   IN CONST CHAR16 *CmdLine\r
   )\r
 {\r
@@ -95,6 +94,25 @@ ContainsSplit(
       }\r
     }\r
   }\r
+  return (TempSpot);\r
+}\r
+\r
+/**\r
+  Determine if a command line contains a split operation\r
+\r
+  @param[in] CmdLine      The command line to parse.\r
+\r
+  @retval TRUE            CmdLine has a valid split.\r
+  @retval FALSE           CmdLine does not have a valid split.\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+ContainsSplit(\r
+  IN CONST CHAR16 *CmdLine\r
+  )\r
+{\r
+  CONST CHAR16 *TempSpot;\r
+  TempSpot = FindSplit(CmdLine);\r
   return (TempSpot != NULL && *TempSpot != CHAR_NULL);\r
 }\r
 \r