diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2009-10-25 17:56:05 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2009-10-25 17:56:05 +0100 |
commit | c612ab35e1081bd37085f6676e8431669b1eed8a (patch) | |
tree | a36946cab049698f6863130cfcd274b670a5e326 /uzbl-core.c | |
parent | 4cf6268cf071a3be55072d40fd2089537d229f81 (diff) |
also perform $PATH-like expansion on spawn_sync (sync_spawn)
Diffstat (limited to 'uzbl-core.c')
-rw-r--r-- | uzbl-core.c | 12 |
1 files changed, 9 insertions, 3 deletions
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 |