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
aa16304c
Commit
aa16304c
authored
Mar 06, 2018
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Mar 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fix handling lines with only values in GetPrivateProfileSection.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2c925f23
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
profile.c
dlls/kernel32/profile.c
+1
-1
profile.c
dlls/kernel32/tests/profile.c
+14
-1
No files found.
dlls/kernel32/profile.c
View file @
aa16304c
...
...
@@ -879,7 +879,7 @@ static INT PROFILE_GetSection( PROFILESECTION *section, LPCWSTR section_name,
for
(
key
=
section
->
key
;
key
;
key
=
key
->
next
)
{
if
(
len
<=
2
)
break
;
if
(
!*
key
->
name
)
continue
;
/* Skip empty lines */
if
(
!*
key
->
name
&&
!
key
->
value
)
continue
;
/* Skip empty lines */
if
(
IS_ENTRY_COMMENT
(
key
->
name
))
continue
;
/* Skip comments */
if
(
!
return_values
&&
!
key
->
value
)
continue
;
/* Skip lines w.o. '=' */
PROFILE_CopyEntry
(
buffer
,
key
->
name
,
len
-
1
,
0
);
...
...
dlls/kernel32/tests/profile.c
View file @
aa16304c
...
...
@@ -171,7 +171,7 @@ static void test_profile_sections(void)
DWORD
count
;
char
buf
[
100
];
char
*
p
;
static
const
char
content
[]
=
"[section1]
\r\n
name1=val1
\r\n
name2=
\r\n
name3
\r\n
name4=val4
\r\n
[section2]
\r\n
"
;
static
const
char
content
[]
=
"[section1]
\r\n
name1=val1
\r\n
name2=
\r\n
name3
\r\n
name4=val4
\r\n
[section2]
\r\n
[section3]
\r\n
=val5
\r\n
"
;
static
const
char
testfile4
[]
=
".
\\
testwine4.ini"
;
BOOL
on_win98
=
FALSE
;
...
...
@@ -241,6 +241,19 @@ static void test_profile_sections(void)
broken
(
GetLastError
()
==
0xdeadbeef
),
/* Win9x, WinME */
"expected ERROR_SUCCESS, got %d
\n
"
,
GetLastError
());
/* Existing section with no keys but has values */
SetLastError
(
0xdeadbeef
);
ret
=
GetPrivateProfileSectionA
(
"section3"
,
buf
,
sizeof
(
buf
),
testfile4
);
trace
(
"section3 return: %s
\n
"
,
buf
);
for
(
p
=
buf
+
strlen
(
buf
)
+
1
;
*
p
;
p
+=
strlen
(
p
)
+
1
)
p
[
-
1
]
=
','
;
ok
(
ret
==
6
&&
!
strcmp
(
buf
,
"=val5"
),
"wrong section returned(%d): %s
\n
"
,
ret
,
buf
);
ok
(
buf
[
ret
-
1
]
==
0
&&
buf
[
ret
]
==
0
,
"returned buffer not terminated with double-null
\n
"
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
||
broken
(
GetLastError
()
==
0xdeadbeef
),
/* Win9x, WinME */
"expected ERROR_SUCCESS, got %d
\n
"
,
GetLastError
());
/* Overflow*/
ret
=
GetPrivateProfileSectionA
(
"section1"
,
buf
,
24
,
testfile4
);
for
(
p
=
buf
+
strlen
(
buf
)
+
1
;
*
p
;
p
+=
strlen
(
p
)
+
1
)
...
...
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