aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/uzbl-core.c
diff options
context:
space:
mode:
authorGravatar Brendan Taylor <whateley@gmail.com>2011-07-12 21:19:37 +0000
committerGravatar Brendan Taylor <whateley@gmail.com>2011-07-12 21:19:37 +0000
commitfc9604fa60645fe7c6129a76bee273bb501b88e6 (patch)
tree0d6e7122796b62e49a2b0db978350c402c560f21 /src/uzbl-core.c
parent57b6e5af1ace03e4ee13903cee881464ee051d24 (diff)
parentff2ddbd300e5c3d3ddf0aaf4f4a16850ca9c8370 (diff)
Merge branch 'master' into experimental
Conflicts: src/uzbl-core.c I accidentally merged a pull request into master, getting everything synced up again.
Diffstat (limited to 'src/uzbl-core.c')
-rw-r--r--src/uzbl-core.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/uzbl-core.c b/src/uzbl-core.c
index 598abdf..4965d8f 100644
--- a/src/uzbl-core.c
+++ b/src/uzbl-core.c
@@ -553,12 +553,16 @@ split_quoted(const gchar* src, const gboolean unquote) {
void
spawn(GArray *argv, GString *result, gboolean exec) {
gchar *path = NULL;
- gchar *arg_car = argv_idx(argv, 0);
- const gchar **arg_cdr = &g_array_index(argv, const gchar *, 1);
- if (arg_car && (path = find_existing_file(arg_car))) {
+ if (!argv_idx(argv, 0))
+ return;
+
+ const gchar **args = &g_array_index(argv, const gchar *, 1);
+
+ path = find_existing_file(argv_idx(argv, 0));
+ if(path) {
gchar *r = NULL;
- run_command(path, arg_cdr, result != NULL, result ? &r : NULL);
+ run_command(path, args, result != NULL, result ? &r : NULL);
if(result) {
g_string_assign(result, r);
// run each line of output from the program as a command
@@ -574,6 +578,8 @@ spawn(GArray *argv, GString *result, gboolean exec) {
}
g_free(r);
g_free(path);
+ } else {
+ g_printerr ("Failed to spawn child process: %s not found\n", argv_idx(argv, 0));
}
}