[PATCH 0/1] MR11115: comdlg32: Treat empty default extension as null.
This (combined with another bug in path handling that I haven't figured out) causes a failure to save a new project in SMILE GAME BUILDER. I was able to reproduce the error using a .NET test program with the SaveFileDialog class. It seems SaveFileDialog, by default, sets the default extension to an empty string. Wine's itemdlg responds to this by appending a "." to the filename. I do not see the extra "." on Windows. Somehow (I haven't figured out how), SMILE GAME BUILDER takes this path and creates a directory with a name ending in ".", on the unix side. When it tries to add a file to that directory, that fails, claiming part of the path could not be found. On Windows, and usually on Wine, I am able to create a directory using a name ending in ".", but the "." is ignored. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11115
From: Esme Povirk <esme@codeweavers.com> --- dlls/comdlg32/itemdlg.c | 2 +- dlls/comdlg32/tests/itemdlg.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/comdlg32/itemdlg.c b/dlls/comdlg32/itemdlg.c index c12ae22e1c7..6e47cb12ca5 100644 --- a/dlls/comdlg32/itemdlg.c +++ b/dlls/comdlg32/itemdlg.c @@ -2876,7 +2876,7 @@ static HRESULT WINAPI IFileDialog2_fnSetDefaultExtension(IFileDialog2 *iface, LP TRACE("%p (%s)\n", This, debugstr_w(pszDefaultExtension)); LocalFree(This->default_ext); - This->default_ext = StrDupW(pszDefaultExtension); + This->default_ext = (pszDefaultExtension && pszDefaultExtension[0]) ? StrDupW(pszDefaultExtension) : NULL; return S_OK; } diff --git a/dlls/comdlg32/tests/itemdlg.c b/dlls/comdlg32/tests/itemdlg.c index c74abd5350a..fa8ae71dd66 100644 --- a/dlls/comdlg32/tests/itemdlg.c +++ b/dlls/comdlg32/tests/itemdlg.c @@ -1528,6 +1528,8 @@ static void test_filename(void) /* No extension */ test_filename_savedlg(filename_noextW, NULL, NULL, NULL, 0, 0, filename_noextW); + /* Empty extension */ + test_filename_savedlg(filename_noextW, NULL, L"", NULL, 0, 0, filename_noextW); /* Default extension */ test_filename_savedlg(filename_noextW, NULL, defextW, NULL, 0, 0, filename_defextW); /* Default extension on filename ending with a . */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11115
participants (2)
-
Esme Povirk -
Esme Povirk (@madewokherd)