From d92c576aa53505d712715b1acc6344af3262c84f Mon Sep 17 00:00:00 2001 From: Pierre Mazière Date: Sun, 24 May 2020 16:38:56 +0200 Subject: Get output and error streams from the command spawned by external_call() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- src/command/cmd_funcs.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/command') diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 55082765..59702fe3 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -4900,7 +4900,7 @@ cmd_sendfile(ProfWin *window, const char *const command, gchar **args) free(filename); return TRUE; } - + if (access(filename, R_OK) != 0) { cons_show_error("Uploading '%s' failed: File not found!", filename); free(filename); @@ -8921,9 +8921,10 @@ cmd_urlopen(ProfWin *window, const char *const command, gchar **args) return TRUE; } - gchar* cmd = prefs_get_string(PREF_URL_OPEN_CMD); - call_external(cmd, args[0]); - g_free(cmd); + gchar *argv[] = {prefs_get_string(PREF_URL_OPEN_CMD), args[0], NULL}; + if (!call_external(argv, NULL, NULL)) { + cons_show_error("Unable to open url: check the logs for more information."); + } } else { cons_show("urlopen not supported in this window"); } -- cgit 1.4.1-2-gfad0