The branch, master has been updated
       via  cbc42b9 Don't allow an empty flag name to --info & --debug.
       via  6ff5824 Document expand_item_list's args & make sure incr==0 works 
OK.
      from  32de6b7 Fix return of stat info from try_dests_reg().

https://git.samba.org/?p=rsync.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit cbc42b9c1668f0c11015c6eceec975b8656063f8
Author: Wayne Davison <way...@samba.org>
Date:   Fri Dec 18 14:46:28 2015 -0800

    Don't allow an empty flag name to --info & --debug.

commit 6ff5824c25cdc586b4cd18f1e90fe226f2bf7a59
Author: Wayne Davison <way...@samba.org>
Date:   Fri Dec 18 14:38:10 2015 -0800

    Document expand_item_list's args & make sure incr==0 works OK.

-----------------------------------------------------------------------

Summary of changes:
 NEWS      |  4 ++++
 OLDNEWS   |  2 +-
 options.c | 16 +++++++---------
 util.c    | 12 ++++++++++--
 4 files changed, 22 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/NEWS b/NEWS
index 1071988..740cb34 100644
--- a/NEWS
+++ b/NEWS
@@ -20,9 +20,13 @@ Changes since 3.1.1:
       right.
     - Don't create an empty backup dir for a transferred file that doesn't
       exist yet.
+    - Fixed a bug where --link-dest and --xattrs could cause rsync to exit if
+      a filename had a matching dir of the same name in the alt-dest area.
     - Allow more than 32 group IDs per user in the daemon's gid=LIST config.
     - Fix the logging of %b & %c via --log-file (daemon logging was already
       correct, as was --out-format='%b/%c').
+    - Fix erroneous acceptance of --info=5 & --debug=5 (an empty flag name is
+      not valid).
 
   ENHANCEMENTS:
 
diff --git a/OLDNEWS b/OLDNEWS
index 5a33d7a..295ab2e 100644
--- a/OLDNEWS
+++ b/OLDNEWS
@@ -3650,7 +3650,7 @@ Changes since 2.4.6:
 
 Partial Protocol History
        RELEASE DATE    VER.    DATE OF COMMIT* PROTOCOL
-       ?? Aug 2015     3.1.2                   31
+       ?? Dec 2015     3.1.2                   31
        22 Jun 2014     3.1.1                   31
        28 Sep 2013     3.1.0   31 Aug 2008     31
        23 Sep 2011     3.0.9                   30
diff --git a/options.c b/options.c
index 7e93ea1..74239bf 100644
--- a/options.c
+++ b/options.c
@@ -411,16 +411,17 @@ static void parse_output_words(struct output_struct 
*words, short *levels,
        const char *s;
        int j, len, lev;
 
-       if (!str)
-               return;
-
-       while (*str) {
+       for ( ; str; str = s) {
                if ((s = strchr(str, ',')) != NULL)
                        len = s++ - str;
                else
                        len = strlen(str);
-               while (len && isDigit(str+len-1))
-                       len--;
+               if (!len)
+                       continue;
+               if (!isDigit(str)) {
+                       while (len && isDigit(str+len-1))
+                               len--;
+               }
                lev = isDigit(str+len) ? atoi(str+len) : 1;
                if (lev > MAX_OUT_LEVEL)
                        lev = MAX_OUT_LEVEL;
@@ -448,9 +449,6 @@ static void parse_output_words(struct output_struct *words, 
short *levels,
                                words[j].help, len, str);
                        exit_cleanup(RERR_SYNTAX);
                }
-               if (!s)
-                       break;
-               str = s;
        }
 }
 
diff --git a/util.c b/util.c
index 41e0c78..3bece5c 100644
--- a/util.c
+++ b/util.c
@@ -1605,6 +1605,12 @@ int flist_ndx_pop(flist_ndx_list *lp)
        return ndx;
 }
 
+/* Make sure there is room for one more item in the item list.  If there
+ * is not, expand the list as indicated by the value of "incr":
+ *  - if incr < 0 then increase the malloced size by -1 * incr
+ *  - if incr >= 0 then either make the malloced size equal to "incr"
+ *    or (if that's not large enough) double the malloced size
+ */
 void *expand_item_list(item_list *lp, size_t item_size,
                       const char *desc, int incr)
 {
@@ -1616,9 +1622,11 @@ void *expand_item_list(item_list *lp, size_t item_size,
                        new_size += -incr; /* increase slowly */
                else if (new_size < (size_t)incr)
                        new_size = incr;
-               else
+               else if (new_size)
                        new_size *= 2;
-               if (new_size < lp->malloced)
+               else
+                       new_size = 1;
+               if (new_size <= lp->malloced)
                        overflow_exit("expand_item_list");
                /* Using _realloc_array() lets us pass the size, not a type. */
                new_ptr = _realloc_array(lp->items, item_size, new_size);


-- 
The rsync repository.

_______________________________________________
rsync-cvs mailing list
rsync-cvs@lists.samba.org
https://lists.samba.org/mailman/listinfo/rsync-cvs

Reply via email to