mirror of https://github.com/fairyglade/ly.git
				
				
				
			Check if lang is NULL and use shorter check (#303)
This commit is contained in:
		
							parent
							
								
									1890da4799
								
							
						
					
					
						commit
						da5b08abf2
					
				
							
								
								
									
										12
									
								
								src/login.c
								
								
								
								
							
							
						
						
									
										12
									
								
								src/login.c
								
								
								
								
							|  | @ -214,21 +214,13 @@ void env_init(struct passwd* pwd) | ||||||
| 	// clean env
 | 	// clean env
 | ||||||
| 	environ[0] = NULL; | 	environ[0] = NULL; | ||||||
| 	 | 	 | ||||||
| 	if (term != NULL) | 	setenv("TERM", term ? term : "linux", 1); | ||||||
| 	{ |  | ||||||
| 		setenv("TERM", term, 1); |  | ||||||
| 	} |  | ||||||
| 	else |  | ||||||
| 	{ |  | ||||||
| 		setenv("TERM", "linux", 1); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	setenv("HOME", pwd->pw_dir, 1); | 	setenv("HOME", pwd->pw_dir, 1); | ||||||
| 	setenv("PWD", pwd->pw_dir, 1); | 	setenv("PWD", pwd->pw_dir, 1); | ||||||
| 	setenv("SHELL", pwd->pw_shell, 1); | 	setenv("SHELL", pwd->pw_shell, 1); | ||||||
| 	setenv("USER", pwd->pw_name, 1); | 	setenv("USER", pwd->pw_name, 1); | ||||||
| 	setenv("LOGNAME", pwd->pw_name, 1); | 	setenv("LOGNAME", pwd->pw_name, 1); | ||||||
| 	setenv("LANG", lang, 1); | 	setenv("LANG", lang ? lang : "C", 1); | ||||||
| 
 | 
 | ||||||
| 	// Set PATH if specified in the configuration
 | 	// Set PATH if specified in the configuration
 | ||||||
| 	if (strlen(config.path)) | 	if (strlen(config.path)) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue