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
7dea6427
Commit
7dea6427
authored
Dec 21, 2015
by
Jeremy White
Committed by
Alexandre Julliard
Dec 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Revise GetLongPathNameA to avoid overriding the input on long names.
Signed-off-by:
Jeremy White
<
jwhite@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ee1260e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
path.c
dlls/kernel32/path.c
+8
-2
path.c
dlls/kernel32/tests/path.c
+0
-1
No files found.
dlls/kernel32/path.c
View file @
7dea6427
...
...
@@ -292,6 +292,7 @@ DWORD WINAPI GetLongPathNameW( LPCWSTR shortpath, LPWSTR longpath, DWORD longlen
BOOL
unixabsolute
;
WIN32_FIND_DATAW
wfd
;
HANDLE
goit
;
BOOL
is_legal_8dot3
;
if
(
!
shortpath
)
{
...
...
@@ -365,7 +366,7 @@ DWORD WINAPI GetLongPathNameW( LPCWSTR shortpath, LPWSTR longpath, DWORD longlen
}
}
/* Check if the file exists
and use the existing file name
*/
/* Check if the file exists */
goit
=
FindFirstFileW
(
tmplongpath
,
&
wfd
);
if
(
goit
==
INVALID_HANDLE_VALUE
)
{
...
...
@@ -374,7 +375,12 @@ DWORD WINAPI GetLongPathNameW( LPCWSTR shortpath, LPWSTR longpath, DWORD longlen
return
0
;
}
FindClose
(
goit
);
strcpyW
(
tmplongpath
+
lp
,
wfd
.
cFileName
);
is_legal_8dot3
=
FALSE
;
CheckNameLegalDOS8Dot3W
(
tmplongpath
+
lp
,
NULL
,
0
,
NULL
,
&
is_legal_8dot3
);
/* Use the existing file name if it's a short name */
if
(
is_legal_8dot3
)
strcpyW
(
tmplongpath
+
lp
,
wfd
.
cFileName
);
lp
+=
strlenW
(
tmplongpath
+
lp
);
sp
+=
tmplen
;
}
...
...
dlls/kernel32/tests/path.c
View file @
7dea6427
...
...
@@ -868,7 +868,6 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive)
"GetLongPathNameA returned '%s' instead of '%s'
\n
"
,
tmpstr1
,
tmpstr
);
tmpstr
[
len
]
=
tolower
(
tmpstr
[
len
]);
ok
(
GetLongPathNameA
(
tmpstr
,
tmpstr1
,
MAX_PATH
),
"GetLongPathNameA failed
\n
"
);
todo_wine
ok
(
lstrcmpA
(
tmpstr
,
tmpstr1
)
==
0
,
"GetLongPathNameA returned '%s' instead of '%s'
\n
"
,
tmpstr1
,
tmpstr
);
sprintf
(
tmpstr
,
"%s/%s"
,
SHORTDIR
,
SHORTFILE
);
...
...
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