Ticket #3444: (mc_popen): use the PATH environment variable

...to search for the executable when opening pipe:
add the G_SPAWN_SEARCH_PATH flag to the g_spawn_async_with_pipes() call,
which cause mc to use the PATH environment variable to search for the
executable.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Ben Woods 2015-04-12 11:44:40 +08:00 committed by Andrew Borodin
parent 6c33f259b6
commit 544a6b625e

View File

@ -528,8 +528,9 @@ mc_popen (const char *command, GError ** error)
goto ret_err;
}
if (!g_spawn_async_with_pipes (NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL,
&p->child_pid, NULL, &p->out.fd, &p->err.fd, error))
if (!g_spawn_async_with_pipes
(NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH, NULL, NULL,
&p->child_pid, NULL, &p->out.fd, &p->err.fd, error))
{
mc_replace_error (error, MC_PIPE_ERROR_CREATE_PIPE_STREAM, "%s",
_("Cannot create pipe streams"));