diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2011-10-23 08:34:01 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2011-10-23 08:34:01 +0000 |
commit | 7ff4cf94050e11517bb6fa89be2f5f4c85af12e3 (patch) | |
tree | c7d09a942ab3b667d9bb3f009523ed9fcfa3d402 /tmux.c | |
parent | 179d0686d78ec6489572e122dbb50220471531a2 (diff) | |
download | rtmux-7ff4cf94050e11517bb6fa89be2f5f4c85af12e3.tar.gz rtmux-7ff4cf94050e11517bb6fa89be2f5f4c85af12e3.tar.bz2 rtmux-7ff4cf94050e11517bb6fa89be2f5f4c85af12e3.zip |
Try to resolve relative paths for loadb and saveb (first using client
working directory if any then default-path or session wd).
Diffstat (limited to 'tmux.c')
-rw-r--r-- | tmux.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -124,6 +124,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) { |