From 2926b0f55122b131e0b9d2cf857d2b78d202c5ab Mon Sep 17 00:00:00 2001 From: Olof-Joachim Frahm Date: Mon, 21 Mar 2011 06:23:23 +0100 Subject: Fixed array bug. When e.g. spawn_sh modifies the array, invalid stuff is send to the python script, which then breaks while decoding them. --- src/uzbl-core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/uzbl-core.c') diff --git a/src/uzbl-core.c b/src/uzbl-core.c index c879602..ba062b6 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -1129,8 +1129,6 @@ spawn_sh_sync(WebKitWebView *web_view, GArray *argv, GString *result) { void run_parsed_command(const CommandInfo *c, GArray *a, GString *result) { - c->function(uzbl.gui.web_view, a, result); - /* send the COMMAND_EXECUTED event, except for set and event/request commands */ if(strcmp("set", c->key) && strcmp("event", c->key) && @@ -1141,12 +1139,18 @@ run_parsed_command(const CommandInfo *c, GArray *a, GString *result) { guint i = 0; while ((p = argv_idx(a, i++))) g_string_append_printf(param, " '%s'", p); + + /* might be destructive on array a */ + c->function(uzbl.gui.web_view, a, result); + send_event(COMMAND_EXECUTED, NULL, TYPE_NAME, c->key, TYPE_FORMATTEDSTR, param->str, NULL); g_string_free(param, TRUE); } + else + c->function(uzbl.gui.web_view, a, result); if(result) { g_free(uzbl.state.last_result); -- cgit v1.2.3