=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tmux.c,v retrieving revision 1.121 retrieving revision 1.122 diff -c -r1.121 -r1.122 *** src/usr.bin/tmux/tmux.c 2013/10/05 08:12:39 1.121 --- src/usr.bin/tmux/tmux.c 2013/10/05 10:40:49 1.122 *************** *** 1,4 **** ! /* $OpenBSD: tmux.c,v 1.121 2013/10/05 08:12:39 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tmux.c,v 1.122 2013/10/05 10:40:49 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 127,149 **** const char* get_full_path(const char *wd, const char *path) { ! int fd; ! static char newpath[MAXPATHLEN]; fd = open(".", O_RDONLY); if (fd == -1) return (NULL); ! if (chdir(wd) != 0) ! return (NULL); ! if (realpath(path, newpath) != 0) ! return (NULL); if (fchdir(fd) != 0) chdir("/"); close(fd); ! return (newpath); } void --- 127,151 ---- const char* get_full_path(const char *wd, const char *path) { ! int fd; ! static char newpath[MAXPATHLEN]; ! const char *retval; fd = open(".", O_RDONLY); if (fd == -1) return (NULL); ! retval = NULL; ! if (chdir(wd) == 0) { ! if (realpath(path, newpath) == 0) ! retval = newpath; ! } if (fchdir(fd) != 0) chdir("/"); close(fd); ! return (retval); } void