aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar DuClare <akarinotengoku@gmail.com>2009-05-29 23:16:21 +0300
committerGravatar DuClare <akarinotengoku@gmail.com>2009-05-29 23:16:21 +0300
commit816fa0aaf162542eaedfcad4ec91a966bc349523 (patch)
treea68ca3cf6a90f9ac43c1f87566bb49cec4480800 /uzbl.c
parentd1c6ba765827f985507283080bf67a2b012f2e17 (diff)
Make parse_cmd_line parse as actions
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/uzbl.c b/uzbl.c
index 51e89e6..fd2a887 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -1602,9 +1602,16 @@ parse_cmd_line(const char *ctl_line) {
|| (ctl_line[0] == ' ')
|| (ctl_line[0] == '\n'))
; /* ignore these lines */
- else
- printf("Command not understood (%s)\n", ctl_line);
-
+ else {
+ gchar *ctlstrip;
+ if (ctl_line[strlen(ctl_line) - 1] == '\n')
+ ctlstrip = g_strndup(ctl_line, strlen(ctl_line) - 1);
+ else ctlstrip = g_strdup(ctl_line);
+ tokens = g_strsplit(ctlstrip, " ", 2);
+
+ parse_command(tokens[0], tokens[1]);
+ g_free(ctlstrip);
+ }
if(tokens)
g_strfreev(tokens);
}