mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Fix crash on reload
If sway is reloaded using a bindsym which has multiple commands, it
failed to detect the reload command, didn't create a duplicate of the
binding and would crash because the reload command frees the bindings.
For example:
    mode system {
        bindsym r reload, mode default
    }
In this example, the binding->command is "reload, mode default".
Fixes #2545
			
			
This commit is contained in:
		
							parent
							
								
									1f1b1b34d6
								
							
						
					
					
						commit
						ebe65a4d48
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -310,7 +310,7 @@ void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding)
 | 
				
			||||||
	bool reload = false;
 | 
						bool reload = false;
 | 
				
			||||||
	// if this is a reload command we need to make a duplicate of the
 | 
						// if this is a reload command we need to make a duplicate of the
 | 
				
			||||||
	// binding since it will be gone after the reload has completed.
 | 
						// binding since it will be gone after the reload has completed.
 | 
				
			||||||
	if (strcasecmp(binding->command, "reload") == 0) {
 | 
						if (strncasecmp(binding->command, "reload", 6) == 0) {
 | 
				
			||||||
		reload = true;
 | 
							reload = true;
 | 
				
			||||||
		binding_copy = sway_binding_dup(binding);
 | 
							binding_copy = sway_binding_dup(binding);
 | 
				
			||||||
		if (!binding_copy) {
 | 
							if (!binding_copy) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue