mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Clear the environment properly by looping until it is empty rather than
looping over it (which may skip entries), from Brad King.
This commit is contained in:
		@@ -196,10 +196,10 @@ void
 | 
				
			|||||||
environ_push(struct environ *env)
 | 
					environ_push(struct environ *env)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct environ_entry	 *envent;
 | 
						struct environ_entry	 *envent;
 | 
				
			||||||
	char			**vp, *v;
 | 
						char			*v;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (vp = environ; *vp != NULL; vp++) {
 | 
						while (*environ != NULL) {
 | 
				
			||||||
		v = xstrdup(*vp);
 | 
							v = xstrdup(*environ);
 | 
				
			||||||
		v[strcspn(v, "=")] = '\0';
 | 
							v[strcspn(v, "=")] = '\0';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		unsetenv(v);
 | 
							unsetenv(v);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user