mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Quote backslash as well for %%%.
This commit is contained in:
		
							
								
								
									
										4
									
								
								cmd.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								cmd.c
									
									
									
									
									
								
							@@ -663,7 +663,7 @@ char *
 | 
			
		||||
cmd_template_replace(const char *template, const char *s, int idx)
 | 
			
		||||
{
 | 
			
		||||
	char		 ch, *buf;
 | 
			
		||||
	const char	*ptr, *cp;
 | 
			
		||||
	const char	*ptr, *cp, quote[] = "\"\\$";
 | 
			
		||||
	int		 replaced, quoted;
 | 
			
		||||
	size_t		 len;
 | 
			
		||||
 | 
			
		||||
@@ -692,7 +692,7 @@ cmd_template_replace(const char *template, const char *s, int idx)
 | 
			
		||||
 | 
			
		||||
			buf = xrealloc(buf, len + (strlen(s) * 2) + 1);
 | 
			
		||||
			for (cp = s; *cp != '\0'; cp++) {
 | 
			
		||||
				if (quoted && (*cp == '"' || *cp == '$'))
 | 
			
		||||
				if (quoted && strchr(quote, *cp) != NULL)
 | 
			
		||||
					buf[len++] = '\\';
 | 
			
		||||
				buf[len++] = *cp;
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user