Jason Edmeades us@edmeades.me.uk writes:
/* Loop through testing each exclude line */
while (pos) {
if (wcsstr(copyFromUpper, pos->name) != NULL) {
WINE_TRACE("Skipping file as matches exclude '%s'\n",
wine_dbgstr_w(pos->name));
wcsstr() doesn't seem the right way to compare file names. You probably want to do a wcsicmp() of the end of the name or something like that.
if (wcsstr(copyFromUpper, pos->name) != NULL) {
wcsstr() doesn't seem the right way to compare file names. You probably want to do a wcsicmp() of the end of the name or something like that.
It's not a file compare, it's a substring compare, eg if the file contains just the letter s, all files with s(/S) in either the directory, name or extension will not get copied. Because there is not a stristr / strstri type function, I uppercase the lines as read from the exclude file when I save them away, and then uppercase the source names when doing the search. Hence I can use strstr (wcsstr) to do the substring matching.
So I think the patch was right...
Until I started thinking harder about it...
There is another unrelated bug, in that the matching should only occur in the new parts of the tree, not in the original stem. My patch would fail all files if you put eg, a ':' in there as I am strstr'ing against an expanded path.
I'll fix that bit and resubmit. If there's anything wrong with the wcsstr logic though, please let me know.
Thanks for the commits Jason