[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Fri Nov 26 10:37:36 MST 2010


The branch, master has been updated
       via  9f5c16e Avoid splitting a multi-byte character when trimming a name. Fixes bug 7816.
      from  8484ddd A couple comment tweaks.

;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 9f5c16e51d274ad9c11b58396c0f9627d95611fb
Author: Wayne Davison <wayned at samba.org>
Date:   Fri Nov 26 09:35:43 2010 -0800

    Avoid splitting a multi-byte character when trimming a name.
    Fixes bug 7816.

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

Summary of changes:
 receiver.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/receiver.c b/receiver.c
index ba3566b..0bc6517 100644
--- a/receiver.c
+++ b/receiver.c
@@ -129,6 +129,14 @@ int get_tmpname(char *fnametmp, const char *fname, BOOL make_unique)
 		added = maxname - 1;
 	suf = fnametmp + length + added;
 
+	/* Trim any dangling high-bit chars if the first-trimmed char (if any) is
+	 * also a high-bit char, just in case we cut into a multi-byte sequence.
+	 * We are guaranteed to stop because of the leading '.' we added. */
+	if ((int)f[added] & 0x80) {
+		while ((int)suf[-1] & 0x80)
+			suf--;
+	}
+
 	if (make_unique) {
 		static unsigned counter_limit;
 		unsigned counter;


-- 
The rsync repository.


More information about the rsync-cvs mailing list