[BACK]Return to tmux.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/tmux.c between version 1.120 and 1.121

version 1.120, 2013/04/24 10:01:32 version 1.121, 2013/10/05 08:12:39
Line 127 
Line 127 
 const char*  const char*
 get_full_path(const char *wd, const char *path)  get_full_path(const char *wd, const char *path)
 {  {
           int             fd;
         static char     newpath[MAXPATHLEN];          static char     newpath[MAXPATHLEN];
         char            oldpath[MAXPATHLEN];  
   
         if (getcwd(oldpath, sizeof oldpath) == NULL)          fd = open(".", O_RDONLY);
           if (fd == -1)
                 return (NULL);                  return (NULL);
   
         if (chdir(wd) != 0)          if (chdir(wd) != 0)
                 return (NULL);                  return (NULL);
         if (realpath(path, newpath) != 0)          if (realpath(path, newpath) != 0)
                 return (NULL);                  return (NULL);
         chdir(oldpath);  
           if (fchdir(fd) != 0)
                   chdir("/");
           close(fd);
   
         return (newpath);          return (newpath);
 }  }
   

Legend:
Removed from v.1.120  
changed lines
  Added in v.1.121