From 930b14a28e78be2884b87c8b4503f3df04de5316 Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Wed, 15 Aug 2001 23:19:21 +0000 Subject: - jakob@cvs.openbsd.org 2001/08/11 22:51:27 [ssh.c tildexpand.c] fix more paths beginning with "//"; . ok markus@ --- tildexpand.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tildexpand.c') diff --git a/tildexpand.c b/tildexpand.c index 46bdaae87..e89a7ade8 100644 --- a/tildexpand.c +++ b/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; } -- cgit v1.2.3