summaryrefslogtreecommitdiff
path: root/tildexpand.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-08-15 23:19:21 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-08-15 23:19:21 +0000
commit930b14a28e78be2884b87c8b4503f3df04de5316 (patch)
treed6e3caf66ee73fe6176fc6d0fa88797ec7e44f8a /tildexpand.c
parent049e0dd6cffbf6b5bffe0e2901957e87caccc869 (diff)
- jakob@cvs.openbsd.org 2001/08/11 22:51:27
[ssh.c tildexpand.c] fix more paths beginning with "//"; <bradshaw@staff.crosswalk.com>. ok markus@
Diffstat (limited to 'tildexpand.c')
-rw-r--r--tildexpand.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tildexpand.c b/tildexpand.c
index 46bdaae87..e89a7ade8 100644
--- a/tildexpand.c
+++ b/tildexpand.c
@@ -11,7 +11,7 @@
11 */ 11 */
12 12
13#include "includes.h" 13#include "includes.h"
14RCSID("$OpenBSD: tildexpand.c,v 1.11 2001/02/08 19:30:53 itojun Exp $"); 14RCSID("$OpenBSD: tildexpand.c,v 1.12 2001/08/11 22:51:27 jakob Exp $");
15 15
16#include "xmalloc.h" 16#include "xmalloc.h"
17#include "log.h" 17#include "log.h"
@@ -67,6 +67,6 @@ tilde_expand_filename(const char *filename, uid_t my_uid)
67 if (len > MAXPATHLEN) 67 if (len > MAXPATHLEN)
68 fatal("Home directory too long (%d > %d", len-1, MAXPATHLEN-1); 68 fatal("Home directory too long (%d > %d", len-1, MAXPATHLEN-1);
69 expanded = xmalloc(len); 69 expanded = xmalloc(len);
70 snprintf(expanded, len, "%s/%s", pw->pw_dir, cp + 1); 70 snprintf(expanded, len, "%s%s%s", pw->pw_dir, strcmp(pw->pw_dir, "/") ? "/" : "", cp + 1);
71 return expanded; 71 return expanded;
72} 72}