mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Do not log NULL command.
This commit is contained in:
		
							
								
								
									
										9
									
								
								spawn.c
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								spawn.c
									
									
									
									
									
								
							| @@ -210,7 +210,7 @@ spawn_pane(struct spawn_context *sc, char **cause) | |||||||
| 	struct environ_entry	 *ee; | 	struct environ_entry	 *ee; | ||||||
| 	char			**argv, *cp, **argvp, *argv0, *cwd; | 	char			**argv, *cp, **argvp, *argv0, *cwd; | ||||||
| 	const char		 *cmd, *tmp; | 	const char		 *cmd, *tmp; | ||||||
| 	int			  argc, before, full_size; | 	int			  argc, full_size; | ||||||
| 	u_int			  idx; | 	u_int			  idx; | ||||||
| 	struct termios		  now; | 	struct termios		  now; | ||||||
| 	u_int			  hlimit; | 	u_int			  hlimit; | ||||||
| @@ -325,13 +325,16 @@ spawn_pane(struct spawn_context *sc, char **cause) | |||||||
| 	environ_set(child, "SHELL", "%s", new_wp->shell); | 	environ_set(child, "SHELL", "%s", new_wp->shell); | ||||||
|  |  | ||||||
| 	/* Log the arguments we are going to use. */ | 	/* Log the arguments we are going to use. */ | ||||||
| 	cp = cmd_stringify_argv(new_wp->argc, new_wp->argv); |  | ||||||
| 	log_debug("%s: shell=%s", __func__, new_wp->shell); | 	log_debug("%s: shell=%s", __func__, new_wp->shell); | ||||||
|  | 	if (new_wp->argc != 0) { | ||||||
|  | 		cp = cmd_stringify_argv(new_wp->argc, new_wp->argv); | ||||||
| 		log_debug("%s: cmd=%s", __func__, cp); | 		log_debug("%s: cmd=%s", __func__, cp); | ||||||
|  | 		free(cp); | ||||||
|  | 	} | ||||||
|  | 	if (cwd != NULL) | ||||||
| 		log_debug("%s: cwd=%s", __func__, cwd); | 		log_debug("%s: cwd=%s", __func__, cwd); | ||||||
| 	cmd_log_argv(new_wp->argc, new_wp->argv, __func__); | 	cmd_log_argv(new_wp->argc, new_wp->argv, __func__); | ||||||
| 	environ_log(child, "%s: environment ", __func__); | 	environ_log(child, "%s: environment ", __func__); | ||||||
| 	free(cp); |  | ||||||
|  |  | ||||||
| 	/* Initialize the window size. */ | 	/* Initialize the window size. */ | ||||||
| 	memset(&ws, 0, sizeof ws); | 	memset(&ws, 0, sizeof ws); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Nicholas Marriott
					Nicholas Marriott