From c612ab35e1081bd37085f6676e8431669b1eed8a Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 25 Oct 2009 17:56:05 +0100 Subject: also perform $PATH-like expansion on spawn_sync (sync_spawn) --- uzbl-core.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'uzbl-core.c') diff --git a/uzbl-core.c b/uzbl-core.c index 1480491..ee97dd3 100644 --- a/uzbl-core.c +++ b/uzbl-core.c @@ -1229,8 +1229,9 @@ void spawn(WebKitWebView *web_view, GArray *argv, GString *result) { (void)web_view; (void)result; gchar *path = NULL; + //TODO: allow more control over argument order so that users can have some arguments before the default ones from run_command, and some after - if ( argv_idx(argv, 0) && + if (argv_idx(argv, 0) && ((path = find_existing_file(argv_idx(argv, 0)))) ) { run_command(path, 0, ((const gchar **) (argv->data + sizeof(gchar*))), @@ -1242,10 +1243,15 @@ spawn(WebKitWebView *web_view, GArray *argv, GString *result) { void spawn_sync(WebKitWebView *web_view, GArray *argv, GString *result) { (void)web_view; (void)result; + gchar *path = NULL; - if (argv_idx(argv, 0)) - run_command(argv_idx(argv, 0), 0, ((const gchar **) (argv->data + sizeof(gchar*))), + if (argv_idx(argv, 0) && + ((path = find_existing_file(argv_idx(argv, 0)))) ) { + run_command(path, 0, + ((const gchar **) (argv->data + sizeof(gchar*))), TRUE, &uzbl.comm.sync_stdout); + g_free(path); + } } void -- cgit v1.2.3