From 16b966be3b6b63ad331d619df654ca1a2082974e Mon Sep 17 00:00:00 2001 From: NRK Date: Fri, 28 Oct 2022 23:17:06 +0600 Subject: [PATCH] spawn(): search $PATH as well makes this function more useful for other people writing patches such as this: https://codeberg.org/nsxiv/nsxiv-extra/src/branch/master/patches/dmenu-search --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.c b/util.c index 043c5bd..cfe64c6 100644 --- a/util.c +++ b/util.c @@ -268,7 +268,7 @@ pid_t spawn(int *readfd, int *writefd, char *const argv[]) if (writefd != NULL && mkspawn_pipe(&fa, cmd, pfd_write, 0) < 0) goto err_close_readfd; - if ((err = posix_spawn(&pid, cmd, &fa, NULL, argv, environ)) != 0) { + if ((err = posix_spawnp(&pid, cmd, &fa, NULL, argv, environ)) != 0) { error(0, err, "spawn: %s", cmd); } else { if (readfd != NULL)