summaryrefslogtreecommitdiff
path: root/compat.c
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2020-05-24 19:16:05 -0700
committerWayne Davison <wayne@opencoder.net>2020-05-24 19:16:05 -0700
commit6efc43cc0aea9ae3e0e3b0ec36cd7cf3d12be15b (patch)
treeb853bf9f04eeeafe9fcc738cdce56195aed68d54 /compat.c
parent4496e0e8e7a7616ef64b683edc7a249ee16b5a1b (diff)
downloadrsync-6efc43cc0aea9ae3e0e3b0ec36cd7cf3d12be15b.tar.gz
Fix -z choice with older rsyncs.
Diffstat (limited to 'compat.c')
-rw-r--r--compat.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/compat.c b/compat.c
index 20dc85fd..f1cc02c7 100644
--- a/compat.c
+++ b/compat.c
@@ -174,7 +174,9 @@ void parse_compress_choice(int final_call)
exit_cleanup(RERR_UNSUPPORTED);
}
do_compression = nni->num;
- } else
+ } else if (do_compression)
+ do_compression = CPRES_ZLIB;
+ else
do_compression = CPRES_NONE;
if (do_compression == CPRES_NONE)
@@ -184,8 +186,10 @@ void parse_compress_choice(int final_call)
const char *c_s = am_server ? "Server" : "Client";
if (valid_compressions.negotiated_name)
rprintf(FINFO, "%s negotiated compress: %s\n", c_s, valid_compressions.negotiated_name);
- else
- rprintf(FINFO, "%s compress: %s\n", c_s, do_compression ? compress_choice : "none");
+ else {
+ struct name_num_item *nni = get_nni_by_num(&valid_compressions, do_compression);
+ rprintf(FINFO, "%s compress: %s\n", c_s, nni ? nni->name : "UNKNOWN");
+ }
}
}