Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
7e9df53f
Commit
7e9df53f
authored
Jul 16, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Jul 17, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fix removing trailing spaces from lpDefault for GetPrivateProfileString.
parent
e5705eae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
20 deletions
+11
-20
profile.c
dlls/kernel32/profile.c
+7
-10
profile.c
dlls/kernel32/tests/profile.c
+4
-10
No files found.
dlls/kernel32/profile.c
View file @
7e9df53f
...
...
@@ -1084,17 +1084,14 @@ static int PROFILE_GetPrivateProfileString( LPCWSTR section, LPCWSTR entry,
/* strip any trailing ' ' of def_val. */
if
(
def_val
)
{
LPCWSTR
p
=
&
def_val
[
strlenW
(
def_val
)
];
/* even "" works ! */
LPCWSTR
p
=
&
def_val
[
strlenW
(
def_val
)
-
1
];
while
(
p
>
def_val
)
{
p
--
;
if
((
*
p
)
!=
' '
)
break
;
}
if
(
*
p
==
' '
)
/* ouch, contained trailing ' ' */
{
int
len
=
(
int
)(
p
-
def_val
);
while
(
p
>
def_val
&&
*
p
==
' '
)
p
--
;
if
(
p
>=
def_val
)
{
int
len
=
(
int
)(
p
-
def_val
)
+
1
;
defval_tmp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
defval_tmp
,
def_val
,
len
*
sizeof
(
WCHAR
));
...
...
dlls/kernel32/tests/profile.c
View file @
7e9df53f
...
...
@@ -418,21 +418,15 @@ static void test_GetPrivateProfileString(void)
lstrcpyA
(
buf
,
"kumquat"
);
ret
=
GetPrivateProfileStringA
(
""
,
"name1"
,
"default "
,
buf
,
MAX_PATH
,
filename
);
todo_wine
{
ok
(
ret
==
7
,
"Expected 7, got %d
\n
"
,
ret
);
ok
(
!
lstrcmpA
(
buf
,
"default"
),
"Expected
\"
default
\"
, got
\"
%s
\"\n
"
,
buf
);
}
ok
(
ret
==
7
,
"Expected 7, got %d
\n
"
,
ret
);
ok
(
!
lstrcmpA
(
buf
,
"default"
),
"Expected
\"
default
\"
, got
\"
%s
\"\n
"
,
buf
);
/* lpAppName is empty, many blank characters in lpDefault */
lstrcpyA
(
buf
,
"kumquat"
);
ret
=
GetPrivateProfileStringA
(
""
,
"name1"
,
"one two "
,
buf
,
MAX_PATH
,
filename
);
todo_wine
{
ok
(
ret
==
7
,
"Expected 7, got %d
\n
"
,
ret
);
ok
(
!
lstrcmpA
(
buf
,
"one two"
),
"Expected
\"
one two
\"
, got
\"
%s
\"\n
"
,
buf
);
}
ok
(
ret
==
7
,
"Expected 7, got %d
\n
"
,
ret
);
ok
(
!
lstrcmpA
(
buf
,
"one two"
),
"Expected
\"
one two
\"
, got
\"
%s
\"\n
"
,
buf
);
/* lpAppName is empty, blank character but not trailing in lpDefault */
lstrcpyA
(
buf
,
"kumquat"
);
...
...
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