mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Do not use c->cwd or s->cwd if it is NULL, found by Ben Boeckel.
This commit is contained in:
		@@ -73,9 +73,9 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
				
			|||||||
		return (CMD_RETURN_WAIT);
 | 
							return (CMD_RETURN_WAIT);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (c != NULL && c->session == NULL)
 | 
						if (c != NULL && c->session == NULL && c->cwd != NULL)
 | 
				
			||||||
		cwd = c->cwd;
 | 
							cwd = c->cwd;
 | 
				
			||||||
	else if ((s = c->session) != NULL)
 | 
						else if ((s = c->session) != NULL && s->cwd != NULL)
 | 
				
			||||||
		cwd = s->cwd;
 | 
							cwd = s->cwd;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		cwd = ".";
 | 
							cwd = ".";
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -142,7 +142,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
				
			|||||||
		format_defaults(ft, c, NULL, NULL, NULL);
 | 
							format_defaults(ft, c, NULL, NULL, NULL);
 | 
				
			||||||
		to_free = cwd = format_expand(ft, args_get(args, 'c'));
 | 
							to_free = cwd = format_expand(ft, args_get(args, 'c'));
 | 
				
			||||||
		format_free(ft);
 | 
							format_free(ft);
 | 
				
			||||||
	} else if (c != NULL && c->session == NULL)
 | 
						} else if (c != NULL && c->session == NULL && c->cwd != NULL)
 | 
				
			||||||
		cwd = c->cwd;
 | 
							cwd = c->cwd;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		cwd = ".";
 | 
							cwd = ".";
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -98,9 +98,9 @@ cmd_save_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
				
			|||||||
		goto do_print;
 | 
							goto do_print;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (c != NULL && c->session == NULL)
 | 
						if (c != NULL && c->session == NULL && c->cwd != NULL)
 | 
				
			||||||
		cwd = c->cwd;
 | 
							cwd = c->cwd;
 | 
				
			||||||
	else if ((s = c->session) != NULL)
 | 
						else if ((s = c->session) != NULL && s->cwd != NULL)
 | 
				
			||||||
		cwd = s->cwd;
 | 
							cwd = s->cwd;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		cwd = ".";
 | 
							cwd = ".";
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user