sbsv2/raptor/util/talon/talon.c
branchfix
changeset 269 62f7cce721ae
parent 255 9a33b42b14b0
child 282 99ac65572b14
--- a/sbsv2/raptor/util/talon/talon.c	Wed Feb 24 16:04:26 2010 +0000
+++ b/sbsv2/raptor/util/talon/talon.c	Thu Feb 25 16:13:04 2010 +0000
@@ -33,6 +33,10 @@
 #include "buffer.h"
 #include "../config.h"
 
+#ifdef HAS_GETCOMMANDLINE
+#include "chomp.h"
+#endif
+
 /* The output semaphore. */
 sbs_semaphore talon_sem;
 
@@ -231,7 +235,6 @@
 
 #ifdef HAS_GETCOMMANDLINE
 	char *commandline= GetCommandLine();
-	DEBUG(("talon: commandline: %s\n", commandline));
 	/*
 	 * The command line should be either,
 	 * talon -c "some shell commands"
@@ -240,21 +243,13 @@
 	 *
 	 * talon could be an absolute path and may have a .exe extension.
 	 */
-	recipe = strstr(commandline, "-c");
+
+	
+	recipe = chompCommand(commandline);
 	if (recipe)
 	{
 		/* there was a -c so extract the quoted commands */
 
-		while (*recipe != '"' && *recipe != '\0')
-			recipe++;
-
-		if (*recipe != '"')    /* we found -c but no following quote */
-		{
-			error("talon: error: unquoted recipe in shell call '%s'\n", commandline);
-			return 1;
-		}
-		recipe++;
-		
 		int recipelen = strlen(recipe);
 		if (recipelen > 0 && recipe[recipelen - 1] == '"')
 			recipe[recipelen - 1] = '\0'; /* remove trailing quote */