Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
59b5f786
Commit
59b5f786
authored
Feb 27, 2000
by
Uwe Bonnes
Committed by
Alexandre Julliard
Feb 27, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GetFullPathName fixes.
parent
9f50d049
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
14 deletions
+27
-14
dos_fs.c
files/dos_fs.c
+27
-14
No files found.
files/dos_fs.c
View file @
59b5f786
...
...
@@ -1075,6 +1075,11 @@ DWORD WINAPI GetLongPathNameW( LPCWSTR shortpath, LPWSTR longpath,
* DOSFS_DoGetFullPathName
*
* Implementation of GetFullPathName32A/W.
*
* Known discrepancies to Win95 OSR2 bon 000118
* "g:..\test should return G:\test
* "..\..\..\..\test should return (Current drive):test
* even when test is not existant
*/
static
DWORD
DOSFS_DoGetFullPathName
(
LPCSTR
name
,
DWORD
len
,
LPSTR
result
,
BOOL
unicode
)
...
...
@@ -1082,6 +1087,7 @@ static DWORD DOSFS_DoGetFullPathName( LPCSTR name, DWORD len, LPSTR result,
char
buffer
[
MAX_PATHNAME_LEN
];
int
drive
;
char
*
p
;
char
namelast
;
DWORD
ret
;
/* Address of the last byte in the buffer */
...
...
@@ -1152,10 +1158,26 @@ static DWORD DOSFS_DoGetFullPathName( LPCSTR name, DWORD len, LPSTR result,
}
}
*
p
=
'\0'
;
/* Only return a trailing \\ if name does end in \\ // or :*/
namelast
=
name
[
strlen
(
name
)
-
1
];
if
(
(
namelast
!=
'\\'
)
&&
(
namelast
!=
'/'
)
&&
(
namelast
!=
':'
)
)
{
if
(
*
(
p
-
1
)
==
'\\'
)
*
(
p
-
1
)
=
'\0'
;
}
if
(
!
(
DRIVE_GetFlags
(
drive
)
&
DRIVE_CASE_PRESERVING
))
CharUpperA
(
buffer
);
CharUpperA
(
buffer
);
/* If the lpBuffer buffer is too small, the return value is the
size of the buffer, in characters, required to hold the path
plus the terminating \0 (tested against win95osr, bon 001118)
. */
ret
=
strlen
(
buffer
);
if
(
ret
>=
len
)
{
/* don't touch anything when the buffer is not large enough */
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
ret
+
1
;
}
if
(
result
)
{
if
(
unicode
)
...
...
@@ -1165,15 +1187,6 @@ static DWORD DOSFS_DoGetFullPathName( LPCSTR name, DWORD len, LPSTR result,
}
TRACE
(
"returning '%s'
\n
"
,
buffer
);
/* If the lpBuffer buffer is too small, the return value is the
size of the buffer, in characters, required to hold the path. */
ret
=
strlen
(
buffer
);
if
(
ret
>=
len
)
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
ret
;
}
...
...
@@ -1187,7 +1200,7 @@ DWORD WINAPI GetFullPathNameA( LPCSTR name, DWORD len, LPSTR buffer,
LPSTR
*
lastpart
)
{
DWORD
ret
=
DOSFS_DoGetFullPathName
(
name
,
len
,
buffer
,
FALSE
);
if
(
ret
&&
buffer
&&
lastpart
)
if
(
ret
&&
(
ret
<=
len
)
&&
buffer
&&
lastpart
)
{
LPSTR
p
=
buffer
+
strlen
(
buffer
);
...
...
@@ -1211,7 +1224,7 @@ DWORD WINAPI GetFullPathNameW( LPCWSTR name, DWORD len, LPWSTR buffer,
LPSTR
nameA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
name
);
DWORD
ret
=
DOSFS_DoGetFullPathName
(
nameA
,
len
,
(
LPSTR
)
buffer
,
TRUE
);
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
if
(
ret
&&
buffer
&&
lastpart
)
if
(
ret
&&
(
ret
<=
len
)
&&
buffer
&&
lastpart
)
{
LPWSTR
p
=
buffer
+
lstrlenW
(
buffer
);
if
(
*
p
!=
(
WCHAR
)
'\\'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment