Browse Source

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>
Ben Woods 10 years ago
parent
commit
544a6b625e
1 changed files with 3 additions and 2 deletions
  1. 3 2
      lib/utilunix.c

+ 3 - 2
lib/utilunix.c

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