=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tmux.c,v retrieving revision 1.106 retrieving revision 1.107 diff -c -r1.106 -r1.107 *** src/usr.bin/tmux/tmux.c 2011/10/23 08:03:27 1.106 --- src/usr.bin/tmux/tmux.c 2011/10/23 08:34:01 1.107 *************** *** 1,4 **** ! /* $OpenBSD: tmux.c,v 1.106 2011/10/23 08:03:27 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tmux.c,v 1.107 2011/10/23 08:34:01 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 122,127 **** --- 122,143 ---- if (strcmp(ptr, progname) == 0) return (1); 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