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
This commit is contained in:
		
							
								
								
									
										2
									
								
								util.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user