start-stop-daemon: Fix regression for --test
The previous fix to --test (PR #34) prevented reading one too many arguments when --exec -or --name was not specified, but created a regression where the last argument would not print if either of those arguments was specified. This corrects the issue. Fixes #41.
This commit is contained in:
		
				
					committed by
					
						
						William Hubbs
					
				
			
			
				
	
			
			
			
						parent
						
							de93587aff
						
					
				
				
					commit
					c1faafcad8
				
			@@ -919,10 +919,13 @@ start_stop_daemon(int argc, char **argv)
 | 
			
		||||
			exec = name;
 | 
			
		||||
		if (name && start)
 | 
			
		||||
			*argv = name;
 | 
			
		||||
	} else if (name)
 | 
			
		||||
	} else if (name) {
 | 
			
		||||
		*--argv = name;
 | 
			
		||||
	else if (exec)
 | 
			
		||||
		++argc;
 | 
			
		||||
    } else if (exec) {
 | 
			
		||||
		*--argv = exec;
 | 
			
		||||
		++argc;
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	if (stop || sig != -1) {
 | 
			
		||||
		if (sig == -1)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user