winefile: Allows paths with spaces
Bruno Jesus
00cpxxx at gmail.com
Sat Dec 13 09:59:42 CST 2014
Test with:
winefile "c:\program files\\common files\\"
Fixes https://bugs.winehq.org/show_bug.cgi?id=37333
-------------- next part --------------
diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c
index dee98c9..7046ad0 100644
--- a/programs/winefile/winefile.c
+++ b/programs/winefile/winefile.c
@@ -1323,9 +1323,17 @@ static ChildWnd* alloc_child_window(LPCWSTR path, LPITEMIDLIST pidl, HWND hwnd)
if (path)
{
- lstrcpyW(child->path, path);
+ int pathlen = strlenW(path);
+ const WCHAR *npath = path;
- _wsplitpath(path, drv, dir, name, ext);
+ if (path[0] == '"' && path[pathlen - 1] == '"')
+ {
+ npath++;
+ pathlen--;
+ }
+ lstrcpynW(child->path, npath, pathlen + 1);
+
+ _wsplitpath(child->path, drv, dir, name, ext);
}
lstrcpyW(child->filter_pattern, sAsterics);
More information about the wine-patches
mailing list