diff options
author | Brendan Taylor <whateley@gmail.com> | 2011-07-12 21:19:37 +0000 |
---|---|---|
committer | Brendan Taylor <whateley@gmail.com> | 2011-07-12 21:19:37 +0000 |
commit | fc9604fa60645fe7c6129a76bee273bb501b88e6 (patch) | |
tree | 0d6e7122796b62e49a2b0db978350c402c560f21 | |
parent | 57b6e5af1ace03e4ee13903cee881464ee051d24 (diff) | |
parent | ff2ddbd300e5c3d3ddf0aaf4f4a16850ca9c8370 (diff) |
Merge branch 'master' into experimental
Conflicts:
src/uzbl-core.c
I accidentally merged a pull request into master, getting everything
synced up again.
-rw-r--r-- | src/util.c | 2 | ||||
-rw-r--r-- | src/uzbl-core.c | 14 |
2 files changed, 11 insertions, 5 deletions
@@ -134,7 +134,7 @@ find_existing_file(const gchar* path_list) { char *basename = strrchr(path_list_dup, ':'); if(!basename) - return path_list_dup; + return file_exists(path_list_dup) ? path_list_dup : NULL; basename[0] = '\0'; basename++; 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)); } } |