]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Avoid negotiating a "none" choice by default
authorWayne Davison <wayne@opencoder.net>
Wed, 24 Jun 2020 02:14:11 +0000 (19:14 -0700)
committerWayne Davison <wayne@opencoder.net>
Wed, 24 Jun 2020 02:20:01 +0000 (19:20 -0700)
The client does not pass "none" as a negotiation choice unless it's from
the user's environment list.  The server still passes the "none" value
to the client unless its environment var excludes it.

compat.c

index 4f225f29e9b0b9a4d91838d7c7581b177c41545d..074a86abb6fc8ae691c5cd5f5cc423705851e4ff 100644 (file)
--- a/compat.c
+++ b/compat.c
@@ -379,7 +379,8 @@ void validate_choice_vs_env(int num1, int num2)
 /* The saw buffer is initialized and used to store ordinal values from 1 to N
  * for the order of the args in the array.  If dup_markup == '\0', duplicates
  * are removed otherwise the char is prefixed to the duplicate term and, if it
- * is an opening paren/bracket/brace, the matching closing char is suffixed. */
+ * is an opening paren/bracket/brace, the matching closing char is suffixed.
+ * "none" is removed on the client side unless dup_markup != '\0'. */
 int get_default_nno_list(struct name_num_obj *nno, char *to_buf, int to_buf_len, char dup_markup)
 {
        struct name_num_item *nni;
@@ -401,6 +402,8 @@ int get_default_nno_list(struct name_num_obj *nno, char *to_buf, int to_buf_len,
                                continue;
                        delim = dup_markup;
                }
+               if (nni->num == 0 && !am_server && !dup_markup)
+                       continue;
                if (len)
                        to_buf[len++]= ' ';
                if (delim) {