aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/uzbl-core.c
diff options
context:
space:
mode:
authorGravatar Olof-Joachim Frahm <Olof.Frahm@web.de>2011-03-21 06:23:23 +0100
committerGravatar Olof-Joachim Frahm <Olof.Frahm@web.de>2011-03-21 06:23:23 +0100
commit2926b0f55122b131e0b9d2cf857d2b78d202c5ab (patch)
tree600d56f03482c9a9be5c4e1ec4b22ff0ade60257 /src/uzbl-core.c
parent0c76d87b6006194ead35c8fb5cf1986fb0367e19 (diff)
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.
Diffstat (limited to 'src/uzbl-core.c')
-rw-r--r--src/uzbl-core.c8
1 files changed, 6 insertions, 2 deletions
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);