Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
c00b0b02
Commit
c00b0b02
authored
20 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Remove trailing spaces from the filename in RtlGetFullPathName_U.
parent
beaa084f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/ntdll/path.c
+10
-3
10 additions, 3 deletions
dlls/ntdll/path.c
dlls/ntdll/tests/path.c
+1
-0
1 addition, 0 deletions
dlls/ntdll/tests/path.c
with
11 additions
and
3 deletions
dlls/ntdll/path.c
+
10
−
3
View file @
c00b0b02
...
...
@@ -533,13 +533,18 @@ static const WCHAR *skip_unc_prefix( const WCHAR *ptr )
*/
static
ULONG
get_full_path_helper
(
LPCWSTR
name
,
LPWSTR
buffer
,
ULONG
size
)
{
ULONG
reqsize
=
0
,
mark
=
0
,
dep
=
0
,
deplen
;
ULONG
reqsize
=
0
,
mark
=
0
,
dep
=
0
,
deplen
,
name_len
;
DOS_PATHNAME_TYPE
type
;
LPWSTR
ins_str
=
NULL
;
LPCWSTR
ptr
;
const
UNICODE_STRING
*
cd
;
WCHAR
tmp
[
4
];
/* remove trailing spaces (yes, Windows really does that, don't ask) */
name_len
=
strlenW
(
name
);
while
(
name_len
&&
name
[
name_len
-
1
]
==
' '
)
name_len
--
;
if
(
!
name_len
)
return
0
;
RtlAcquirePebLock
();
if
(
NtCurrentTeb
()
->
Tib
.
SubSystemTib
)
/* FIXME: hack */
...
...
@@ -674,7 +679,7 @@ static ULONG get_full_path_helper(LPCWSTR name, LPWSTR buffer, ULONG size)
}
/* enough space ? */
deplen
=
strlenW
(
name
+
dep
)
*
sizeof
(
WCHAR
);
deplen
=
(
name_len
-
dep
)
*
sizeof
(
WCHAR
);
if
(
reqsize
+
deplen
+
sizeof
(
WCHAR
)
>
size
)
{
/* not enough space, return need size (including terminating '\0') */
...
...
@@ -682,7 +687,8 @@ static ULONG get_full_path_helper(LPCWSTR name, LPWSTR buffer, ULONG size)
goto
done
;
}
memmove
(
buffer
+
reqsize
/
sizeof
(
WCHAR
),
name
+
dep
,
deplen
+
sizeof
(
WCHAR
));
memmove
(
buffer
+
reqsize
/
sizeof
(
WCHAR
),
name
+
dep
,
deplen
);
buffer
[(
reqsize
+
deplen
)
/
sizeof
(
WCHAR
)]
=
0
;
if
(
reqsize
)
memcpy
(
buffer
,
ins_str
,
reqsize
);
reqsize
+=
deplen
;
...
...
@@ -737,6 +743,7 @@ DWORD WINAPI RtlGetFullPathName_U(const WCHAR* name, ULONG size, WCHAR* buffer,
}
reqsize
=
get_full_path_helper
(
name
,
buffer
,
size
);
if
(
!
reqsize
)
return
0
;
if
(
reqsize
>
size
)
{
LPWSTR
tmp
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
reqsize
);
...
...
This diff is collapsed.
Click to expand it.
dlls/ntdll/tests/path.c
+
1
−
0
View file @
c00b0b02
...
...
@@ -239,6 +239,7 @@ static void test_RtlGetFullPathName_U()
static
const
struct
test
tests
[]
=
{
{
"c:/test"
,
"c:
\\
test"
,
"test"
},
{
"c:/test "
,
"c:
\\
test"
,
"test"
},
{
"c:/TEST"
,
"c:
\\
test"
,
"test"
},
{
"c:/test/file"
,
"c:
\\
test
\\
file"
,
"file"
},
{
"c:/test/././file"
,
"c:
\\
test
\\
file"
,
"file"
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment