mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Sync OpenBSD patchset 968:
Try to resolve relative paths for loadb and saveb (first using client working directory if any then default-path or session wd).
This commit is contained in:
		
							
								
								
									
										16
									
								
								tmux.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								tmux.c
									
									
									
									
									
								
							@@ -127,6 +127,22 @@ areshell(const char *shell)
 | 
			
		||||
	return (0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char*
 | 
			
		||||
get_full_path(const char *wd, const char *path)
 | 
			
		||||
{
 | 
			
		||||
	static char	newpath[MAXPATHLEN];
 | 
			
		||||
	char		oldpath[MAXPATHLEN];
 | 
			
		||||
 | 
			
		||||
	if (getcwd(oldpath, sizeof oldpath) == NULL)
 | 
			
		||||
		return (NULL);
 | 
			
		||||
	if (chdir(wd) != 0)
 | 
			
		||||
		return (NULL);
 | 
			
		||||
	if (realpath(path, newpath) != 0)
 | 
			
		||||
		return (NULL);
 | 
			
		||||
	chdir(oldpath);
 | 
			
		||||
	return (newpath);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
parseenvironment(void)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user