nsxiv16b966b
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
+1 −1
1 file changed
- M util.c +1 −1
| @@ -268,7 +268,7 @@ pid_t spawn(int *readfd, int *writefd, char *const argv[]) | |||
| 268 | 268 | if (writefd != NULL && mkspawn_pipe(&fa, cmd, pfd_write, 0) < 0) | |
| 269 | 269 | goto err_close_readfd; | |
| 270 | 270 | ||
| 271 | − | if ((err = posix_spawn(&pid, cmd, &fa, NULL, argv, environ)) != 0) { | |
| 271 | + | if ((err = posix_spawnp(&pid, cmd, &fa, NULL, argv, environ)) != 0) { | |
| 272 | 272 | error(0, err, "spawn: %s", cmd); | |
| 273 | 273 | } else { | |
| 274 | 274 | if (readfd != NULL) | |