Changed some names since "depth" wasn't really the right term.
[rsync/rsync.git] / main.c
diff --git a/main.c b/main.c
index a33f7a7..629eb35 100644 (file)
--- 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 e;
        extern int orig_umask;
 
        if (verbose > 2)
@@ -310,7 +311,7 @@ static char *get_local_name(struct file_list *flist,char *name)
                return name;
        }
 
-       if (flist->count <= 1)
+       if (flist->count <= 1 && ((e = strlen(name)) <= 1 || name[e-1] != '/'))
                return name;
 
        if (do_mkdir(name,0777 & ~orig_umask) != 0) {
@@ -1055,6 +1056,5 @@ int main(int argc,char *argv[])
        else
                exit_cleanup(ret);
 
-       exit(ret);
-       /* NOTREACHED */
+       return ret;
 }