git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04aec4c
)
r2400: make ms_fnmatch() case insensitive. This is much more efficient than
author
Andrew Tridgell
<tridge@samba.org>
Sat, 18 Sep 2004 08:12:55 +0000
(08:12 +0000)
committer
Gerald (Jerry) Carter
<jerry@samba.org>
Wed, 10 Oct 2007 17:58:48 +0000
(12:58 -0500)
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.
source/lib/ms_fnmatch.c
patch
|
blob
|
history
diff --git
a/source/lib/ms_fnmatch.c
b/source/lib/ms_fnmatch.c
index 1c4b3d1806b7221d5abbc38d65d085bf8a613a6f..5a9edc2c8798e5d77a0928e7e91cad2f6cd5d492 100644
(file)
--- a/
source/lib/ms_fnmatch.c
+++ b/
source/lib/ms_fnmatch.c
@@
-94,7
+94,8
@@
static int ms_fnmatch_lanman_core(const smb_ucs2_t *pattern,
break;
default:
- if (c != *n) goto nomatch;
+ if (c != *n &&
+ toupper_w(c) != toupper_w(*n)) goto nomatch;
n++;
}
}
@@
-198,7
+199,8
@@
static int ms_fnmatch_w(const smb_ucs2_t *pattern, const smb_ucs2_t *string,
break;
default:
- if (c != *n) return -1;
+ if (c != *n &&
+ toupper_w(c) != toupper_w(*n)) return -1;
n++;
}
}