svn commit: samba r2400 - in branches/SAMBA_4_0/source/lib: .

tridge at samba.org tridge at samba.org
Sat Sep 18 08:12:55 GMT 2004


Author: tridge
Date: 2004-09-18 08:12:55 +0000 (Sat, 18 Sep 2004)
New Revision: 2400

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/lib&rev=2400&nolog=1

Log:
make ms_fnmatch() case insensitive. This is much more efficient than
uppercasing the two whole strings before the call is made, is less
error-prone, and also copes with strings where the upper case version
is longer than the lower case version due to different multi-byte lengths.


Modified:
   branches/SAMBA_4_0/source/lib/ms_fnmatch.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ms_fnmatch.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ms_fnmatch.c	2004-09-18 06:31:56 UTC (rev 2399)
+++ branches/SAMBA_4_0/source/lib/ms_fnmatch.c	2004-09-18 08:12:55 UTC (rev 2400)
@@ -94,7 +94,8 @@
 			break;
 
 		default:
-			if (c != *n) goto nomatch;
+			if (c != *n &&
+			    toupper_w(c) != toupper_w(*n)) goto nomatch;
 			n++;
 		}
 	}
@@ -198,7 +199,8 @@
 			break;
 
 		default:
-			if (c != *n) return -1;
+			if (c != *n &&
+			    toupper_w(c) != toupper_w(*n)) return -1;
 			n++;
 		}
 	}



More information about the samba-cvs mailing list