summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2023-01-08 21:35:39 -0800
committerWayne Davison <wayne@opencoder.net>2023-01-08 21:35:39 -0800
commit90df93e446f9ebbfd4ce97d6755c5fe1f45f9fd0 (patch)
tree0bc6b7f0f14067002ed29be7e4b71c6ec6ff4ca7
parent5c93dedf4538426982f8832fa9103f09a78a01ad (diff)
downloadrsync-90df93e446f9ebbfd4ce97d6755c5fe1f45f9fd0.tar.gz
Don't call memcmp() on an empty lastdir.
-rw-r--r--flist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/flist.c b/flist.c
index 65b459b1..4eb672f1 100644
--- a/flist.c
+++ b/flist.c
@@ -2367,7 +2367,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
}
dirlen = dir ? strlen(dir) : 0;
- if (dirlen != lastdir_len || memcmp(lastdir, dir, dirlen) != 0) {
+ if (dirlen != lastdir_len || (dirlen && memcmp(lastdir, dir, dirlen) != 0)) {
if (!change_pathname(NULL, dir, -dirlen))
goto bad_path;
lastdir = pathname;