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
9a10234e
Commit
9a10234e
authored
Apr 02, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Apr 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fix creation of empty sections in ini files.
parent
e09fc215
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
30 deletions
+12
-30
profile.c
dlls/kernel32/profile.c
+6
-6
profile.c
dlls/kernel32/tests/profile.c
+6
-24
No files found.
dlls/kernel32/profile.c
View file @
9a10234e
...
...
@@ -202,9 +202,9 @@ static void PROFILE_Save( HANDLE hFile, const PROFILESECTION *section, ENCODING
for
(
;
section
;
section
=
section
->
next
)
{
int
len
=
4
;
int
len
=
0
;
if
(
section
->
name
[
0
])
len
+=
strlenW
(
section
->
name
);
if
(
section
->
name
[
0
])
len
+=
strlenW
(
section
->
name
)
+
4
;
for
(
key
=
section
->
key
;
key
;
key
=
key
->
next
)
{
...
...
@@ -216,15 +216,15 @@ static void PROFILE_Save( HANDLE hFile, const PROFILESECTION *section, ENCODING
if
(
!
buffer
)
return
;
p
=
buffer
;
*
p
++
=
'['
;
if
(
section
->
name
[
0
])
{
*
p
++
=
'['
;
strcpyW
(
p
,
section
->
name
);
p
+=
strlenW
(
p
);
*
p
++
=
']'
;
*
p
++
=
'\r'
;
*
p
++
=
'\n'
;
}
*
p
++
=
']'
;
*
p
++
=
'\r'
;
*
p
++
=
'\n'
;
for
(
key
=
section
->
key
;
key
;
key
=
key
->
next
)
{
...
...
dlls/kernel32/tests/profile.c
View file @
9a10234e
...
...
@@ -972,10 +972,7 @@ static void test_WritePrivateProfileString(void)
"key5=string5
\r\n
"
;
ret
=
WritePrivateProfileStringA
(
"App3"
,
"key5"
,
"string5"
,
path
);
ok
(
ret
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
ret
);
todo_wine
{
ok
(
check_file_data
(
path
,
data
),
"File doesn't match
\n
"
);
}
ok
(
check_file_data
(
path
,
data
),
"File doesn't match
\n
"
);
/* lpString is NULL, key2 key is deleted */
data
=
"[App1]
\r\n
"
...
...
@@ -987,10 +984,7 @@ static void test_WritePrivateProfileString(void)
"key5=string5
\r\n
"
;
ret
=
WritePrivateProfileStringA
(
"App1"
,
"key2"
,
NULL
,
path
);
ok
(
ret
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
ret
);
todo_wine
{
ok
(
check_file_data
(
path
,
data
),
"File doesn't match
\n
"
);
}
ok
(
check_file_data
(
path
,
data
),
"File doesn't match
\n
"
);
/* try to delete key2 again */
data
=
"[App1]
\r\n
"
...
...
@@ -1002,10 +996,7 @@ static void test_WritePrivateProfileString(void)
"key5=string5
\r\n
"
;
ret
=
WritePrivateProfileStringA
(
"App1"
,
"key2"
,
NULL
,
path
);
ok
(
ret
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
ret
);
todo_wine
{
ok
(
check_file_data
(
path
,
data
),
"File doesn't match
\n
"
);
}
ok
(
check_file_data
(
path
,
data
),
"File doesn't match
\n
"
);
/* lpKeyName is NULL, App1 section is deleted */
data
=
"[App2]
\r\n
"
...
...
@@ -1014,29 +1005,20 @@ static void test_WritePrivateProfileString(void)
"key5=string5
\r\n
"
;
ret
=
WritePrivateProfileStringA
(
"App1"
,
NULL
,
"string1"
,
path
);
ok
(
ret
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
ret
);
todo_wine
{
ok
(
check_file_data
(
path
,
data
),
"File doesn't match
\n
"
);
}
ok
(
check_file_data
(
path
,
data
),
"File doesn't match
\n
"
);
/* lpString is not needed to delete a section */
data
=
"[App3]
\r\n
"
"key5=string5
\r\n
"
;
ret
=
WritePrivateProfileStringA
(
"App2"
,
NULL
,
NULL
,
path
);
ok
(
ret
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
ret
);
todo_wine
{
ok
(
check_file_data
(
path
,
data
),
"File doesn't match
\n
"
);
}
ok
(
check_file_data
(
path
,
data
),
"File doesn't match
\n
"
);
/* leave just the section */
data
=
"[App3]
\r\n
"
;
ret
=
WritePrivateProfileStringA
(
"App3"
,
"key5"
,
NULL
,
path
);
ok
(
ret
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
ret
);
todo_wine
{
ok
(
check_file_data
(
path
,
data
),
"File doesn't match
\n
"
);
}
ok
(
check_file_data
(
path
,
data
),
"File doesn't match
\n
"
);
DeleteFileA
(
path
);
}
...
...
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