mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Merge pull request #2118 from RedSoxFan/fix-2117
Remove strip quoting and fix strncpy-overlap
This commit is contained in:
		
						commit
						bf6ca69ae8
					
				
					 2 changed files with 1 additions and 2 deletions
				
			
		| 
						 | 
					@ -274,7 +274,6 @@ struct cmd_results *execute_command(char *_exec, struct sway_seat *seat) {
 | 
				
			||||||
			for (int i = handler->handle == cmd_set ? 2 : 1; i < argc; ++i) {
 | 
								for (int i = handler->handle == cmd_set ? 2 : 1; i < argc; ++i) {
 | 
				
			||||||
				argv[i] = do_var_replacement(argv[i]);
 | 
									argv[i] = do_var_replacement(argv[i]);
 | 
				
			||||||
				unescape_string(argv[i]);
 | 
									unescape_string(argv[i]);
 | 
				
			||||||
				strip_quotes(argv[i]);
 | 
					 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (!config->handler_context.using_criteria) {
 | 
								if (!config->handler_context.using_criteria) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -660,7 +660,7 @@ char *do_var_replacement(char *str) {
 | 
				
			||||||
		// Unescape double $ and move on
 | 
							// Unescape double $ and move on
 | 
				
			||||||
		if (find[1] == '$') {
 | 
							if (find[1] == '$') {
 | 
				
			||||||
			size_t length = strlen(find + 1);
 | 
								size_t length = strlen(find + 1);
 | 
				
			||||||
			strncpy(find, find + 1, length);
 | 
								memmove(find, find + 1, length);
 | 
				
			||||||
			find[length] = '\0';
 | 
								find[length] = '\0';
 | 
				
			||||||
			++find;
 | 
								++find;
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue