mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	window_add_pane cannot fail, so remove the unused cause argument and don't
bother to check for a NULL return.
This commit is contained in:
		@@ -184,9 +184,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_ctx *ctx)
 | 
				
			|||||||
	if (data->flag_horizontal)
 | 
						if (data->flag_horizontal)
 | 
				
			||||||
		type = LAYOUT_LEFTRIGHT;
 | 
							type = LAYOUT_LEFTRIGHT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wp = window_add_pane(w, hlimit, &cause);
 | 
						wp = window_add_pane(w, hlimit);
 | 
				
			||||||
	if (wp == NULL)
 | 
					 | 
				
			||||||
		goto error;
 | 
					 | 
				
			||||||
	if (window_pane_spawn(wp, cmd, cwd, env, &cause) != 0)
 | 
						if (window_pane_spawn(wp, cmd, cwd, env, &cause) != 0)
 | 
				
			||||||
		goto error;
 | 
							goto error;
 | 
				
			||||||
	if (layout_split_pane(w->active, type, size, wp) != 0) {
 | 
						if (layout_split_pane(w->active, type, size, wp) != 0) {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								tmux.h
									
									
									
									
									
								
							@@ -1469,7 +1469,7 @@ struct window	*window_create(const char *, const char *,
 | 
				
			|||||||
		     const char *, const char **, u_int, u_int, u_int, char **);
 | 
							     const char *, const char **, u_int, u_int, u_int, char **);
 | 
				
			||||||
void		 window_destroy(struct window *);
 | 
					void		 window_destroy(struct window *);
 | 
				
			||||||
void		 window_set_active_pane(struct window *, struct window_pane *);
 | 
					void		 window_set_active_pane(struct window *, struct window_pane *);
 | 
				
			||||||
struct window_pane *window_add_pane(struct window *, u_int, char **);
 | 
					struct window_pane *window_add_pane(struct window *, u_int);
 | 
				
			||||||
void		 window_resize(struct window *, u_int, u_int);
 | 
					void		 window_resize(struct window *, u_int, u_int);
 | 
				
			||||||
void		 window_remove_pane(struct window *, struct window_pane *);
 | 
					void		 window_remove_pane(struct window *, struct window_pane *);
 | 
				
			||||||
struct window_pane *window_pane_at_index(struct window *, u_int);
 | 
					struct window_pane *window_pane_at_index(struct window *, u_int);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										7
									
								
								window.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								window.c
									
									
									
									
									
								
							@@ -260,10 +260,7 @@ window_create(const char *name, const char *cmd, const char *cwd,
 | 
				
			|||||||
	struct window_pane	*wp;
 | 
						struct window_pane	*wp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	w = window_create1(sx, sy);
 | 
						w = window_create1(sx, sy);
 | 
				
			||||||
	if ((wp = window_add_pane(w, hlimit, cause)) == NULL) {
 | 
						wp = window_add_pane(w, hlimit);
 | 
				
			||||||
		window_destroy(w);
 | 
					 | 
				
			||||||
		return (NULL);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	layout_init(w);
 | 
						layout_init(w);
 | 
				
			||||||
	if (window_pane_spawn(wp, cmd, cwd, envp, cause) != 0) {
 | 
						if (window_pane_spawn(wp, cmd, cwd, envp, cause) != 0) {
 | 
				
			||||||
		window_destroy(w);
 | 
							window_destroy(w);
 | 
				
			||||||
@@ -322,7 +319,7 @@ window_set_active_pane(struct window *w, struct window_pane *wp)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct window_pane *
 | 
					struct window_pane *
 | 
				
			||||||
window_add_pane(struct window *w, u_int hlimit, unused char **cause)
 | 
					window_add_pane(struct window *w, u_int hlimit)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct window_pane	*wp;
 | 
						struct window_pane	*wp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user