mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Merge branch 'obsd-master'
This commit is contained in:
		
							
								
								
									
										17
									
								
								format.c
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								format.c
									
									
									
									
									
								
							@@ -519,7 +519,6 @@ format_merge(struct format_tree *ft, struct format_tree *from)
 | 
			
		||||
		if (fe->value != NULL)
 | 
			
		||||
			format_add(ft, fe->key, "%s", fe->value);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Create a new tree. */
 | 
			
		||||
@@ -1081,6 +1080,22 @@ format_expand(struct format_tree *ft, const char *fmt)
 | 
			
		||||
	return (buf);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Expand a single string. */
 | 
			
		||||
char *
 | 
			
		||||
format_single(struct cmdq_item *item, const char *fmt, struct client *c,
 | 
			
		||||
    struct session *s, struct winlink *wl, struct window_pane *wp)
 | 
			
		||||
{
 | 
			
		||||
	struct format_tree	*ft;
 | 
			
		||||
	char			*expanded;
 | 
			
		||||
 | 
			
		||||
	ft = format_create(item, FORMAT_NONE, 0);
 | 
			
		||||
	format_defaults(ft, c, s, wl, wp);
 | 
			
		||||
 | 
			
		||||
	expanded = format_expand(ft, fmt);
 | 
			
		||||
	format_free(ft);
 | 
			
		||||
	return (expanded);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Set defaults for any of arguments that are not NULL. */
 | 
			
		||||
void
 | 
			
		||||
format_defaults(struct format_tree *ft, struct client *c, struct session *s,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user