]> andersk Git - openssh.git/blobdiff - tildexpand.c
change "No more 4-term BSD licenses in our tree" to
[openssh.git] / tildexpand.c
index b72744683b74219e92668621d9450c352267980c..cbe981146730b308291e9fd17a30ba40b8e1f3a9 100644 (file)
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: tildexpand.c,v 1.10 2001/01/21 19:06:01 markus Exp $");
+RCSID("$OpenBSD: tildexpand.c,v 1.13 2002/06/23 03:25:50 deraadt Exp $");
 
 #include "xmalloc.h"
 #include "log.h"
+#include "tildexpand.h"
 
 /*
  * Expands tildes in the file name.  Returns data allocated by xmalloc.
@@ -66,6 +67,7 @@ tilde_expand_filename(const char *filename, uid_t my_uid)
        if (len > MAXPATHLEN)
                fatal("Home directory too long (%d > %d", len-1, MAXPATHLEN-1);
        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;
 }
This page took 0.048666 seconds and 4 git commands to generate.