[v2] kernel32: properly deal with double path delimiters in GetShortPathName.

Peter Beutner p.beutner at gmx.net
Wed Aug 10 08:27:10 CDT 2016


v2: ignore previous attempt, this is a better fix i think

Remove the extra if clause that deals with paths starting with ".\\". The
code a few lines below that handles "." or ".." as part of the path
already handles that case.
That way the code handling path delimiters will properly work for
paths starting with ".\\\\".

Fixes https://bugs.winehq.org/show_bug.cgi?id=41002

Signed-off-by: Peter Beutner <p.beutner at gmx.net>
---
 dlls/kernel32/path.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
index 620401d..3eff35e 100644
--- a/dlls/kernel32/path.c
+++ b/dlls/kernel32/path.c
@@ -510,12 +510,6 @@ DWORD WINAPI GetShortPathNameW( LPCWSTR longpath, LPWSTR shortpath, DWORD shortl
         }
 
         p = longpath + lp;
-        if (lp == 0 && p[0] == '.' && (p[1] == '/' || p[1] == '\\'))
-        {
-            tmpshortpath[sp++] = *p++;
-            tmpshortpath[sp++] = *p++;
-            lp += 2;
-        }
         for (; *p && *p != '/' && *p != '\\'; p++);
         tmplen = p - (longpath + lp);
         lstrcpynW(tmpshortpath + sp, longpath + lp, tmplen + 1);
-- 
2.7.3




More information about the wine-patches mailing list