mirror of
https://github.com/reactos/wine.git
synced 2024-11-28 14:10:32 +00:00
comdlg32: File dialog: Append multi-part extensions like .abc.def.
This commit is contained in:
parent
ef3ed04cdc
commit
c5ad37baf0
@ -2596,10 +2596,11 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
|
||||
filterSearchIndex[0] = '\0';
|
||||
}
|
||||
|
||||
/* find the file extension by searching for the first dot in filterExt */
|
||||
/* strip the * or anything else from the extension, "*.abc" becomes "abc" */
|
||||
/* if the extension is invalid or contains a glob, ignore it */
|
||||
filterSearchIndex = PathFindExtensionW(filterExt);
|
||||
if (*filterSearchIndex++ && !strchrW(filterSearchIndex, '*') && !strchrW(filterSearchIndex, '?'))
|
||||
filterSearchIndex = strchrW(filterExt, '.');
|
||||
if (filterSearchIndex++ && !strchrW(filterSearchIndex, '*') && !strchrW(filterSearchIndex, '?'))
|
||||
{
|
||||
strcpyW(filterExt, filterSearchIndex);
|
||||
}
|
||||
|
@ -1130,6 +1130,11 @@ static void test_extension(void)
|
||||
for (i = 0; i < ARRAY_SIZE(defext_wildcard_filters); i++) {
|
||||
test_extension_helper(&ofn, defext_wildcard_filters[i], "deadbeef.xyz");
|
||||
}
|
||||
|
||||
/* Append valid extensions consisting of multiple parts */
|
||||
test_extension_helper(&ofn, "TestFilter (*.abc.def)\0*.abc.def\0", "deadbeef.abc.def");
|
||||
test_extension_helper(&ofn, "TestFilter (.abc.def)\0.abc.def\0", "deadbeef.abc.def");
|
||||
test_extension_helper(&ofn, "TestFilter (*.*.def)\0*.*.def\0", "deadbeef.xyz");
|
||||
}
|
||||
|
||||
#undef ARRAY_SIZE
|
||||
|
Loading…
Reference in New Issue
Block a user