Get output and error streams from the command spawned by external_call()

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière
2020-05-24 16:38:56 +02:00
parent f1fe18b474
commit d92c576aa5
4 changed files with 93 additions and 14 deletions

View File

@@ -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");
}