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
									
									
									
									
									
								
							@@ -1660,13 +1660,15 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen,
 | 
				
			|||||||
			goto fail;
 | 
								goto fail;
 | 
				
			||||||
	} else if (search != NULL) {
 | 
						} else if (search != NULL) {
 | 
				
			||||||
		/* Search in pane. */
 | 
							/* Search in pane. */
 | 
				
			||||||
 | 
							new = format_expand(ft, copy);
 | 
				
			||||||
		if (wp == NULL) {
 | 
							if (wp == NULL) {
 | 
				
			||||||
			format_log(ft, "search '%s' but no pane", copy);
 | 
								format_log(ft, "search '%s' but no pane", new);
 | 
				
			||||||
			value = xstrdup("0");
 | 
								value = xstrdup("0");
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			format_log(ft, "search '%s' pane %%%u", copy,  wp->id);
 | 
								format_log(ft, "search '%s' pane %%%u", new,  wp->id);
 | 
				
			||||||
			value = format_search(fm, wp, copy);
 | 
								value = format_search(fm, wp, new);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							free(new);
 | 
				
			||||||
	} else if (cmp != NULL) {
 | 
						} else if (cmp != NULL) {
 | 
				
			||||||
		/* Comparison of left and right. */
 | 
							/* Comparison of left and right. */
 | 
				
			||||||
		if (format_choose(ft, copy, &left, &right, 1) != 0) {
 | 
							if (format_choose(ft, copy, &left, &right, 1) != 0) {
 | 
				
			||||||
@@ -1796,11 +1798,14 @@ done:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	/* Perform substitution if any. */
 | 
						/* Perform substitution if any. */
 | 
				
			||||||
	if (sub != NULL) {
 | 
						if (sub != NULL) {
 | 
				
			||||||
		new = format_sub(sub, value, sub->argv[0], sub->argv[1]);
 | 
							left = format_expand(ft, sub->argv[0]);
 | 
				
			||||||
		format_log(ft, "substituted '%s' to '%s': %s", sub->argv[0],
 | 
							right = format_expand(ft, sub->argv[1]);
 | 
				
			||||||
		    sub->argv[1], new);
 | 
							new = format_sub(sub, value, left, right);
 | 
				
			||||||
 | 
							format_log(ft, "substitute '%s' to '%s': %s", left, right, new);
 | 
				
			||||||
		free(value);
 | 
							free(value);
 | 
				
			||||||
		value = new;
 | 
							value = new;
 | 
				
			||||||
 | 
							free(right);
 | 
				
			||||||
 | 
							free(left);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Truncate the value if needed. */
 | 
						/* Truncate the value if needed. */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user