From a9c00c66d0495d0a78dd50467d14de16bae6ea46 Mon Sep 17 00:00:00 2001 From: Bruno Jesus <00cpxxx@gmail.com> Date: Sat, 13 Dec 2014 13:59:42 -0200 Subject: [PATCH] winefile: Allow paths with spaces. --- programs/winefile/winefile.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c index dee98c97206..7046ad050b7 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);