X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/9fbec6e44c7381ab28e78a991d37b57092459e99..5ebe9a46d7f3c846a6d665cb8c6ab8b79508a6df:/main.c diff --git a/main.c b/main.c index 0455734d..161bfad8 100644 --- a/main.c +++ b/main.c @@ -130,7 +130,7 @@ static void show_malloc_stats(void); pid_t wait_process(pid_t pid, int *status_ptr, int flags) { pid_t waited_pid; - + do { waited_pid = waitpid(pid, status_ptr, flags); } while (waited_pid == -1 && errno == EINTR); @@ -576,6 +576,10 @@ static char *get_local_name(struct file_list *flist, char *dest_path) if (!dest_path || list_only) return NULL; + /* Treat an empty string as a copy into the current directory. */ + if (!*dest_path) + dest_path = "."; + if (daemon_filter_list.head) { char *slash = strrchr(dest_path, '/'); if (slash && (slash[1] == '\0' || (slash[1] == '.' && slash[2] == '\0')))