mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Fix format expansion in window names, reported by Suraj N Kurapati.
This commit is contained in:
		
							
								
								
									
										5
									
								
								spawn.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								spawn.c
									
									
									
									
									
								
							@@ -80,6 +80,8 @@ spawn_log(const char *from, struct spawn_context *sc)
 | 
				
			|||||||
struct winlink *
 | 
					struct winlink *
 | 
				
			||||||
spawn_window(struct spawn_context *sc, char **cause)
 | 
					spawn_window(struct spawn_context *sc, char **cause)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						struct cmdq_item	*item = sc->item;
 | 
				
			||||||
 | 
						struct client		*c = item->client;
 | 
				
			||||||
	struct session		*s = sc->s;
 | 
						struct session		*s = sc->s;
 | 
				
			||||||
	struct window		*w;
 | 
						struct window		*w;
 | 
				
			||||||
	struct window_pane	*wp;
 | 
						struct window_pane	*wp;
 | 
				
			||||||
@@ -182,7 +184,8 @@ spawn_window(struct spawn_context *sc, char **cause)
 | 
				
			|||||||
	/* Set the name of the new window. */
 | 
						/* Set the name of the new window. */
 | 
				
			||||||
	if (~sc->flags & SPAWN_RESPAWN) {
 | 
						if (~sc->flags & SPAWN_RESPAWN) {
 | 
				
			||||||
		if (sc->name != NULL) {
 | 
							if (sc->name != NULL) {
 | 
				
			||||||
			w->name = xstrdup(sc->name);
 | 
								w->name = format_single(item, sc->name, c, s, NULL,
 | 
				
			||||||
 | 
								    NULL);
 | 
				
			||||||
			options_set_number(w->options, "automatic-rename", 0);
 | 
								options_set_number(w->options, "automatic-rename", 0);
 | 
				
			||||||
		} else
 | 
							} else
 | 
				
			||||||
			w->name = xstrdup(default_window_name(w));
 | 
								w->name = xstrdup(default_window_name(w));
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user