nix run: Fix segfault on macOS
Note that clearenv() is not available on macOS. Fixes #1907.
This commit is contained in:
		
							parent
							
								
									9432f3fb7d
								
							
						
					
					
						commit
						24ec750003
					
				
					 3 changed files with 11 additions and 3 deletions
				
			
		|  | @ -73,6 +73,13 @@ std::map<std::string, std::string> getEnv() | |||
| } | ||||
| 
 | ||||
| 
 | ||||
| void clearEnv() | ||||
| { | ||||
|     for (auto & name : getEnv()) | ||||
|         unsetenv(name.first.c_str()); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| Path absPath(Path path, Path dir) | ||||
| { | ||||
|     if (path[0] != '/') { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue