Don't strip any whitespace to process input.
authorDaniel Carl <danielcarl@gmx.de>
Sat, 16 Feb 2013 14:34:59 +0000 (15:34 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Sat, 16 Feb 2013 14:36:43 +0000 (15:36 +0100)
The whitespace might be relevant input like for the input commands where
something like ':input :open ' is useful.

src/main.c

index 8b91bce..c8ee0b3 100644 (file)
@@ -283,7 +283,6 @@ static void vp_inspector_finished(WebKitWebInspector* inspector)
 static gboolean vp_process_input(const char* input)
 {
     gboolean success;
-    char* line = NULL;
     char* command = NULL;
     char** token;
 
@@ -291,15 +290,11 @@ static gboolean vp_process_input(const char* input)
         return FALSE;
     }
 
-    line = g_strdup(input);
-    g_strstrip(line);
-
     /* get a possible command count */
-    vp.state.count = g_ascii_strtoll(line, &command, 10);
+    vp.state.count = g_ascii_strtoll(input, &command, 10);
 
     /* split the input string into command and parameter part */
     token = g_strsplit(command, " ", 2);
-    g_free(line);
 
     if (!token[0]) {
         g_strfreev(token);