summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/tildexpand.c
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@cvs.openbsd.org>2001-08-11 22:51:28 +0000
committerJakob Schlyter <jakob@cvs.openbsd.org>2001-08-11 22:51:28 +0000
commitb155f718b1e8a1788f60d95a1ac064f03f3c3cd7 (patch)
treefea6c76c9f876b089cc263cbcfd81cbd0a7cba08 /usr.bin/ssh/tildexpand.c
parent797914da4dfa0981079c3d08ef04a9f9c2f9d379 (diff)
fix more paths beginning with "//"; <bradshaw@staff.crosswalk.com>. ok markus@
Diffstat (limited to 'usr.bin/ssh/tildexpand.c')
-rw-r--r--usr.bin/ssh/tildexpand.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ssh/tildexpand.c b/usr.bin/ssh/tildexpand.c
index 46bdaae87ba..e89a7ade8ac 100644
--- a/usr.bin/ssh/tildexpand.c
+++ b/usr.bin/ssh/tildexpand.c
@@ -11,7 +11,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: tildexpand.c,v 1.11 2001/02/08 19:30:53 itojun Exp $");
+RCSID("$OpenBSD: tildexpand.c,v 1.12 2001/08/11 22:51:27 jakob Exp $");
#include "xmalloc.h"
#include "log.h"
@@ -67,6 +67,6 @@ 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;
}