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

Diff for /src/usr.bin/ssh/Attic/tildexpand.c between version 1.8 and 1.8.2.5

version 1.8, 2000/09/07 20:27:55 version 1.8.2.5, 2001/09/27 00:15:43
Line 14 
Line 14 
 RCSID("$OpenBSD$");  RCSID("$OpenBSD$");
   
 #include "xmalloc.h"  #include "xmalloc.h"
 #include "ssh.h"  #include "log.h"
   #include "tildexpand.h"
   
 /*  /*
  * Expands tildes in the file name.  Returns data allocated by xmalloc.   * Expands tildes in the file name.  Returns data allocated by xmalloc.
Line 24 
Line 25 
 tilde_expand_filename(const char *filename, uid_t my_uid)  tilde_expand_filename(const char *filename, uid_t my_uid)
 {  {
         const char *cp;          const char *cp;
         unsigned int userlen;          u_int userlen;
         char *expanded;          char *expanded;
         struct passwd *pw;          struct passwd *pw;
         char user[100];          char user[100];
Line 66 
Line 67 
         if (len > MAXPATHLEN)          if (len > MAXPATHLEN)
                 fatal("Home directory too long (%d > %d", len-1, MAXPATHLEN-1);                  fatal("Home directory too long (%d > %d", len-1, MAXPATHLEN-1);
         expanded = xmalloc(len);          expanded = xmalloc(len);
         snprintf(expanded, len, "%s/%s", pw->pw_dir, cp + 1);          snprintf(expanded, len, "%s%s%s", pw->pw_dir, strcmp(pw->pw_dir, "/") ? "/" : "", cp + 1);
         return expanded;          return expanded;
 }  }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.8.2.5