]> andersk Git - openssh.git/blobdiff - tildexpand.c
- (dtucker) [auth-pam.c scard-opensc.c] Tinderbox says auth-pam.c uses
[openssh.git] / tildexpand.c
index b72744683b74219e92668621d9450c352267980c..40aa11965e4c95ced92fa2414c5e221595ddf438 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: tildexpand.c,v 1.10 2001/01/21 19:06:01 markus Exp $");
+RCSID("$OpenBSD: tildexpand.c,v 1.14 2004/05/08 00:01:37 deraadt Exp $");
 
 #include "xmalloc.h"
 #include "log.h"
@@ -66,6 +66,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.031052 seconds and 4 git commands to generate.