assign environ to a temp variable to ensure liveness
This commit is contained in:
		
							parent
							
								
									8079ab87a2
								
							
						
					
					
						commit
						c0d55f9183
					
				
					 1 changed files with 6 additions and 3 deletions
				
			
		|  | @ -446,10 +446,13 @@ int main(int argc, char ** argv) | ||||||
|                     ? Strings{"bash", "--rcfile", rcfile} |                     ? Strings{"bash", "--rcfile", rcfile} | ||||||
|                     : Strings{"bash", rcfile}; |                     : Strings{"bash", rcfile}; | ||||||
| 
 | 
 | ||||||
|                 environ = stringsToCharPtrs(envStrs).data(); |                 auto envPtrs = stringsToCharPtrs(envStrs); | ||||||
| 
 | 
 | ||||||
|                 execvp(getEnv("NIX_BUILD_SHELL", "bash").c_str(), |                 environ = envPtrs.data(); | ||||||
|                     stringsToCharPtrs(args).data()); | 
 | ||||||
|  |                 auto argPtrs = stringsToCharPtrs(args); | ||||||
|  | 
 | ||||||
|  |                 execvp(getEnv("NIX_BUILD_SHELL", "bash").c_str(), argPtrs.data()); | ||||||
| 
 | 
 | ||||||
|                 throw SysError("executing shell"); |                 throw SysError("executing shell"); | ||||||
|             } |             } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue