svn commit: samba r9273 - in branches/SAMBA_3_0_RELEASE: . source/lib

jerry at samba.org jerry at samba.org
Fri Aug 12 21:06:50 GMT 2005


Author: jerry
Date: 2005-08-12 21:06:49 +0000 (Fri, 12 Aug 2005)
New Revision: 9273

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9273

Log:
merge jra's fix for non-enlish characters in strncmp_w()
Modified:
   branches/SAMBA_3_0_RELEASE/WHATSNEW.txt
   branches/SAMBA_3_0_RELEASE/source/lib/util_str.c
   branches/SAMBA_3_0_RELEASE/source/lib/util_unistr.c


Changeset:
Modified: branches/SAMBA_3_0_RELEASE/WHATSNEW.txt
===================================================================
--- branches/SAMBA_3_0_RELEASE/WHATSNEW.txt	2005-08-12 20:58:56 UTC (rev 9272)
+++ branches/SAMBA_3_0_RELEASE/WHATSNEW.txt	2005-08-12 21:06:49 UTC (rev 9273)
@@ -47,6 +47,8 @@
 o   Jeremy Allison <jra at samba.org>
     * Fix minor compiler warnings in printing/printing.c.
     * Merge new DOS error code from SAMBA_4.
+    * Fix issue when non-English characters in filenames and 
+      directories.
 
 
 o   Gerald (Jerry) Carter <jerry at samba.org>

Modified: branches/SAMBA_3_0_RELEASE/source/lib/util_str.c
===================================================================
--- branches/SAMBA_3_0_RELEASE/source/lib/util_str.c	2005-08-12 20:58:56 UTC (rev 9272)
+++ branches/SAMBA_3_0_RELEASE/source/lib/util_str.c	2005-08-12 21:06:49 UTC (rev 9273)
@@ -183,7 +183,7 @@
 int StrCaseCmp(const char *s, const char *t)
 {
 
-	const char * ps, * pt;
+	const char *ps, *pt;
 	size_t size;
 	smb_ucs2_t *buffer_s, *buffer_t;
 	int ret;
@@ -211,17 +211,17 @@
 			return +1;
 	}
 
-	size = push_ucs2_allocate(&buffer_s, s);
+	size = push_ucs2_allocate(&buffer_s, ps);
 	if (size == (size_t)-1) {
-		return strcmp(s, t); 
+		return strcmp(ps, pt); 
 		/* Not quite the right answer, but finding the right one
 		   under this failure case is expensive, and it's pretty close */
 	}
 	
-	size = push_ucs2_allocate(&buffer_t, t);
+	size = push_ucs2_allocate(&buffer_t, pt);
 	if (size == (size_t)-1) {
 		SAFE_FREE(buffer_s);
-		return strcmp(s, t); 
+		return strcmp(ps, pt); 
 		/* Not quite the right answer, but finding the right one
 		   under this failure case is expensive, and it's pretty close */
 	}

Modified: branches/SAMBA_3_0_RELEASE/source/lib/util_unistr.c
===================================================================
--- branches/SAMBA_3_0_RELEASE/source/lib/util_unistr.c	2005-08-12 20:58:56 UTC (rev 9272)
+++ branches/SAMBA_3_0_RELEASE/source/lib/util_unistr.c	2005-08-12 21:06:49 UTC (rev 9273)
@@ -568,7 +568,7 @@
 		a++;
 		b++;
 	}
-	return cpa - cpb;
+	return (*(COPY_UCS2_CHAR(&cpa,a)) - *(COPY_UCS2_CHAR(&cpb,b)));
 	/* warning: if *a != *b and both are not 0 we return a random
 		greater or lesser than 0 number not realted to which
 		string is longer */
@@ -584,7 +584,7 @@
 		b++;
 		n++;
 	}
-	return (len - n)?(cpa - cpb):0;
+	return (len - n)?(*(COPY_UCS2_CHAR(&cpa,a)) - *(COPY_UCS2_CHAR(&cpb,b))):0;
 }
 
 /*******************************************************************
@@ -599,7 +599,7 @@
 		a++;
 		b++;
 	}
-	return (tolower_w(cpa) - tolower_w(cpb));
+	return (tolower_w(*(COPY_UCS2_CHAR(&cpa,a))) - tolower_w(*(COPY_UCS2_CHAR(&cpb,b))));
 }
 
 /*******************************************************************
@@ -616,7 +616,7 @@
 		b++;
 		n++;
 	}
-	return (len - n)?(tolower_w(cpa) - tolower_w(cpb)):0;
+	return (len - n)?(tolower_w(*(COPY_UCS2_CHAR(&cpa,a))) - tolower_w(*(COPY_UCS2_CHAR(&cpb,b)))):0;
 }
 
 /*******************************************************************



More information about the samba-cvs mailing list