-I've attached a context diff for some changes I made to our local copy
-a while back to add an "--ignore-case" option just for this purpose.
-In our case it came up in the context of disting between NTFS and FAT
-remote systems. I think we ended up not needing it, but it does make
-rsync match filenames in a case insensitive manner, so it might at
-least be worth trying to see if it resolves your issue. [NOTE: patch
-updated for latest CVS source way Wayne Davison, but UNTESTED!]
-
-A few caveats - both ends have to support the option - I couldn't make
-it backwards compatible because both ends exchange information about a
-sorted file list that has to sort the same way on either side (which
-very subtly bit me when I first did this). I also didn't bump the
-protocol in this patch (wasn't quite sure it was appropriate just for an
-incompatible command line option) since since it was for local use.
-
-The patch is based on a 2.4.x series rsync, but if it doesn't apply
-cleanly to 2.5.x, it's should be simple enough to just apply manually.
-
--- David
-
-/-----------------------------------------------------------------------\
- \ David Bolen \ E-mail: db3l@fitlinxx.com /
- | FitLinxx, Inc. \ Phone: (203) 708-5192 |
- / 860 Canal Street, Stamford, CT 06902 \ Fax: (203) 316-5150 \
-\-----------------------------------------------------------------------/
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
-
-Index: options.c
---- options.c 22 Feb 2004 08:56:43 -0000 1.139
-+++ options.c 23 Feb 2004 19:25:19 -0000
-@@ -87,6 +87,7 @@ int opt_ignore_existing = 0;
- int max_delete = 0;
+--- old/flist.c
++++ new/flist.c
+@@ -32,6 +32,7 @@ extern int am_sender;
+ extern int do_progress;
+ extern int always_checksum;
+ extern int module_id;
++extern int ignore_case;
+ extern int ignore_errors;
+ extern int numeric_ids;
+ extern int recurse;
+@@ -1783,7 +1784,7 @@ int f_name_cmp(struct file_struct *f1, s
+ if (type1 != type2)
+ return type1 == t_PATH ? 1 : -1;
+
+- do {
++ while (1) {
+ if (!*c1) {
+ switch (state1) {
+ case s_DIR:
+@@ -1846,7 +1847,16 @@ int f_name_cmp(struct file_struct *f1, s
+ if (type1 != type2)
+ return type1 == t_PATH ? 1 : -1;
+ }
+- } while ((dif = (int)*c1++ - (int)*c2++) == 0);
++ if (ignore_case) {
++ uchar ch1, ch2;
++ ch1 = islower(*c1) ? toupper(*c1) : *c1;
++ ch2 = islower(*c2) ? toupper(*c2) : *c2;
++ c1++, c2++;
++ if ((dif = (int)ch1 - (int)ch2) != 0)
++ break;
++ } else if ((dif = (int)*c1++ - (int)*c2++) != 0)
++ break;
++ }
+
+ return dif;
+ }
+--- old/lib/wildmatch.c
++++ new/lib/wildmatch.c
+@@ -53,6 +53,8 @@
+ #define ISUPPER(c) (ISASCII(c) && isupper(c))
+ #define ISXDIGIT(c) (ISASCII(c) && isxdigit(c))
+
++extern int ignore_case;
++
+ #ifdef WILD_TEST_ITERATIONS
+ int wildmatch_iteration_count;
+ #endif
+@@ -72,6 +74,8 @@ static int dowild(const uchar *p, const
+ for ( ; (p_ch = *p) != '\0'; text++, p++) {
+ int matched, special;
+ uchar t_ch, prev_ch;
++ if (ignore_case && ISUPPER(p_ch))
++ p_ch = tolower(p_ch);
+ while ((t_ch = *text) == '\0') {
+ if (*a == NULL) {
+ if (p_ch != '*')
+@@ -288,10 +292,14 @@ static const uchar *trailing_N_elements(
+ int wildmatch(const char *pattern, const char *text)
+ {
+ static const uchar *nomore[1]; /* A NULL pointer. */
++ int ret;
+ #ifdef WILD_TEST_ITERATIONS
+ wildmatch_iteration_count = 0;
+ #endif
+- return dowild((const uchar*)pattern, (const uchar*)text, nomore) == TRUE;
++ force_lower_case = ignore_case;
++ ret = dowild((const uchar*)pattern, (const uchar*)text, nomore) == TRUE;
++ force_lower_case = 0;
++ return ret;
+ }
+
+ /* Match the "pattern" against the forced-to-lower-case "text" string. */
+--- old/options.c
++++ new/options.c
+@@ -111,6 +111,7 @@ OFF_T max_size = 0;
+ OFF_T min_size = 0;