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
d88fbb7a
Commit
d88fbb7a
authored
Jun 20, 2000
by
Uwe Bonnes
Committed by
Alexandre Julliard
Jun 20, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make WritePrivateProfileSectionA care for "" and NULL as the
string argument. New function PROFILE_DeleteAllKeys.
parent
e6ba02e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
profile.c
files/profile.c
+34
-2
No files found.
files/profile.c
View file @
d88fbb7a
...
...
@@ -393,6 +393,34 @@ static BOOL PROFILE_DeleteKey( PROFILESECTION **section,
/***********************************************************************
* PROFILE_DeleteAllKeys
*
* Delete all keys from a profile tree.
*/
void
PROFILE_DeleteAllKeys
(
LPCSTR
section_name
)
{
PROFILESECTION
**
section
=
&
CurProfile
->
section
;
while
(
*
section
)
{
if
((
*
section
)
->
name
&&
!
strcasecmp
(
(
*
section
)
->
name
,
section_name
))
{
PROFILEKEY
**
key
=
&
(
*
section
)
->
key
;
while
(
*
key
)
{
PROFILEKEY
*
to_del
=
*
key
;
*
key
=
to_del
->
next
;
if
(
to_del
->
name
)
HeapFree
(
GetProcessHeap
(),
0
,
to_del
->
name
);
if
(
to_del
->
value
)
HeapFree
(
GetProcessHeap
(),
0
,
to_del
->
value
);
HeapFree
(
GetProcessHeap
(),
0
,
to_del
);
CurProfile
->
changed
=
TRUE
;
}
}
section
=
&
(
*
section
)
->
next
;
}
}
/***********************************************************************
* PROFILE_Find
*
* Find a key in a profile tree, optionally creating it.
...
...
@@ -1386,9 +1414,13 @@ BOOL WINAPI WritePrivateProfileSectionA( LPCSTR section,
if
(
PROFILE_Open
(
filename
))
{
if
(
!
section
&&
!
string
&&
!
filename
)
PROFILE_ReleaseFile
();
/* always return FALSE in this case */
else
if
(
!
string
)
/* delete the named section*/
ret
=
PROFILE_SetString
(
section
,
NULL
,
NULL
);
else
{
while
(
*
string
){
LPSTR
buf
=
HEAP_strdupA
(
GetProcessHeap
(),
0
,
string
);
PROFILE_DeleteAllKeys
(
section
);
ret
=
TRUE
;
while
(
*
string
)
{
LPSTR
buf
=
HEAP_strdupA
(
GetProcessHeap
(),
0
,
string
);
if
((
p
=
strchr
(
buf
,
'='
))){
*
p
=
'\0'
;
ret
=
PROFILE_SetString
(
section
,
buf
,
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