[RosApps|WineFile]
authorJames Tabor <james.tabor@reactos.org>
Tue, 22 Sep 2015 00:40:19 +0000 (00:40 +0000)
committerJames Tabor <james.tabor@reactos.org>
Tue, 22 Sep 2015 00:40:19 +0000 (00:40 +0000)
Patch by Jared Smudde - Sync wine File with wine. See ROSAPPS-302.

svn path=/trunk/; revision=69313

rosapps/applications/winfile/splitpath.c
rosapps/applications/winfile/winefile.c

index 7425147..95a4373 100644 (file)
@@ -35,9 +35,8 @@ void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR*
        } else if (drv)
                *drv = '\0';
 
        } else if (drv)
                *drv = '\0';
 
-       /* search for end of string or stream separator */
-       for(end=path; *end && *end!=':'; )
-               end++;
+    /* Don't parse colons as stream separators when splitting paths */
+    end = path + lstrlenW(path);
 
        /* search for begin of file extension */
        for(p=end; p>path && *--p!='\\' && *p!='/'; )
 
        /* search for begin of file extension */
        for(p=end; p>path && *--p!='\\' && *p!='/'; )
index cdbcefc..54705f7 100644 (file)
@@ -1323,9 +1323,17 @@ static ChildWnd* alloc_child_window(LPCWSTR path, LPITEMIDLIST pidl, HWND hwnd)
 
        if (path)
        {
 
        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);
        }
 
        lstrcpyW(child->filter_pattern, sAsterics);
@@ -1757,11 +1765,11 @@ static void PropDlg_DisplayValue(HWND hlbox, HWND hedit)
 
 static void CheckForFileInfo(struct PropertiesDialog* dlg, HWND hwnd, LPCWSTR strFilename)
 {
 
 static void CheckForFileInfo(struct PropertiesDialog* dlg, HWND hwnd, LPCWSTR strFilename)
 {
-       static WCHAR sBackSlash[] = {'\\','\0'};
-       static WCHAR sTranslation[] = {'\\','V','a','r','F','i','l','e','I','n','f','o','\\','T','r','a','n','s','l','a','t','i','o','n','\0'};
-       static WCHAR sStringFileInfo[] = {'\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o','\\',
+       static const WCHAR sBackSlash[] = {'\\','\0'};
+       static const WCHAR sTranslation[] = {'\\','V','a','r','F','i','l','e','I','n','f','o','\\','T','r','a','n','s','l','a','t','i','o','n','\0'};
+       static const WCHAR sStringFileInfo[] = {'\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o','\\',
                                                                                '%','0','4','x','%','0','4','x','\\','%','s','\0'};
                                                                                '%','0','4','x','%','0','4','x','\\','%','s','\0'};
-        static WCHAR sFmt[] = {'%','d','.','%','d','.','%','d','.','%','d','\0'};
+        static const WCHAR sFmt[] = {'%','d','.','%','d','.','%','d','.','%','d','\0'};
        DWORD dwVersionDataLen = GetFileVersionInfoSizeW(strFilename, NULL);
 
        if (dwVersionDataLen) {
        DWORD dwVersionDataLen = GetFileVersionInfoSizeW(strFilename, NULL);
 
        if (dwVersionDataLen) {