From f6b8d591f77056e1b0bf103c28af4432d6332234 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 24 Apr 2003 16:14:33 +0000 Subject: [PATCH] If the user specifies a trailing slash on the destination, make sure that we treat it as a directory reference. --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index a33f7a7f..29ee6ada 100644 --- a/main.c +++ b/main.c @@ -285,6 +285,7 @@ oom: static char *get_local_name(struct file_list *flist,char *name) { STRUCT_STAT st; + int len; extern int orig_umask; if (verbose > 2) @@ -310,7 +311,8 @@ static char *get_local_name(struct file_list *flist,char *name) return name; } - if (flist->count <= 1) + len = strlen(name); + if ((len <= 1 || name[len-1] != '/') && flist->count <= 1) return name; if (do_mkdir(name,0777 & ~orig_umask) != 0) { -- 2.34.1