From 4c5c7e7a048078b4c1445ed8859f9a0fb69475ec Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 21 Jun 2002 19:00:13 +0000 Subject: [PATCH] Fixed regression caused by previous change. --- files/dos_fs.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/files/dos_fs.c b/files/dos_fs.c index 74be98e54d5..85021ff4a5f 100644 --- a/files/dos_fs.c +++ b/files/dos_fs.c @@ -1027,6 +1027,7 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath, DWORD sp = 0, lp = 0; int tmplen, drive; UINT flags; + BOOL unixabsolute = *longpath == '/'; TRACE("%s\n", debugstr_a(longpath)); @@ -1044,12 +1045,21 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath, return 0; } + /* check for drive letter */ + if (!unixabsolute && longpath[1] == ':' ) { + tmpshortpath[0] = longpath[0]; + tmpshortpath[1] = ':'; + sp = 2; + } + if ( ( drive = DOSFS_GetPathDrive ( &longpath )) == -1 ) return 0; flags = DRIVE_GetFlags ( drive ); - tmpshortpath[0] = drive + 'A'; - tmpshortpath[1] = ':'; - sp = 2; + if (unixabsolute && drive != DRIVE_GetCurrentDrive()) { + tmpshortpath[0] = drive + 'A'; + tmpshortpath[1] = ':'; + sp = 2; + } while ( longpath[lp] ) {