mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Merge pull request #1204 from zandrmartin/prevent-layout-auto-crash
prevent crash when `layout auto` is missing args
This commit is contained in:
		
						commit
						5e845a38f5
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -85,6 +85,10 @@ static struct cmd_results *cmd_layout_auto(swayc_t *container, int argc, char **
 | 
				
			||||||
	enum swayc_layouts old_layout = container->layout;
 | 
						enum swayc_layouts old_layout = container->layout;
 | 
				
			||||||
	enum swayc_layouts layout = old_layout;
 | 
						enum swayc_layouts layout = old_layout;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if ((error = checkarg(argc, "layout auto", EXPECTED_MORE_THAN, 1))) {
 | 
				
			||||||
 | 
							return error;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (strcasecmp(argv[1], "left") == 0) {
 | 
						if (strcasecmp(argv[1], "left") == 0) {
 | 
				
			||||||
		layout = L_AUTO_LEFT;
 | 
							layout = L_AUTO_LEFT;
 | 
				
			||||||
	} else if (strcasecmp(argv[1], "right") == 0) {
 | 
						} else if (strcasecmp(argv[1], "right") == 0) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue