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
e61b792f
Commit
e61b792f
authored
Jul 31, 1999
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove file from cache when flushing it (based on a patch by Ian
Schmidt).
parent
4a0af422
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
31 deletions
+34
-31
profile.c
files/profile.c
+34
-31
No files found.
files/profile.c
View file @
e61b792f
...
...
@@ -406,6 +406,27 @@ static BOOL PROFILE_FlushFile(void)
/***********************************************************************
* PROFILE_ReleaseFile
*
* Flush the current profile to disk and remove it from the cache.
*/
static
void
PROFILE_ReleaseFile
(
void
)
{
PROFILE_FlushFile
();
PROFILE_Free
(
CurProfile
->
section
);
if
(
CurProfile
->
dos_name
)
HeapFree
(
SystemHeap
,
0
,
CurProfile
->
dos_name
);
if
(
CurProfile
->
unix_name
)
HeapFree
(
SystemHeap
,
0
,
CurProfile
->
unix_name
);
if
(
CurProfile
->
filename
)
HeapFree
(
SystemHeap
,
0
,
CurProfile
->
filename
);
CurProfile
->
changed
=
FALSE
;
CurProfile
->
section
=
NULL
;
CurProfile
->
dos_name
=
NULL
;
CurProfile
->
unix_name
=
NULL
;
CurProfile
->
filename
=
NULL
;
CurProfile
->
mtime
=
0
;
}
/***********************************************************************
* PROFILE_Open
*
* Open a profile file, checking the cached file first.
...
...
@@ -484,20 +505,7 @@ static BOOL PROFILE_Open( LPCSTR filename )
/* Flush the profile */
if
(
CurProfile
->
filename
)
{
PROFILE_FlushFile
();
PROFILE_Free
(
CurProfile
->
section
);
if
(
CurProfile
->
dos_name
)
HeapFree
(
SystemHeap
,
0
,
CurProfile
->
dos_name
);
if
(
CurProfile
->
unix_name
)
HeapFree
(
SystemHeap
,
0
,
CurProfile
->
unix_name
);
if
(
CurProfile
->
filename
)
HeapFree
(
SystemHeap
,
0
,
CurProfile
->
filename
);
CurProfile
->
changed
=
FALSE
;
CurProfile
->
section
=
NULL
;
CurProfile
->
dos_name
=
NULL
;
CurProfile
->
unix_name
=
NULL
;
CurProfile
->
filename
=
NULL
;
CurProfile
->
mtime
=
0
;
}
if
(
CurProfile
->
filename
)
PROFILE_ReleaseFile
();
newdos_name
=
HEAP_strdupA
(
SystemHeap
,
0
,
full_name
.
short_name
);
CurProfile
->
dos_name
=
newdos_name
;
...
...
@@ -1261,20 +1269,19 @@ BOOL16 WINAPI WritePrivateProfileString16( LPCSTR section, LPCSTR entry,
BOOL
WINAPI
WritePrivateProfileStringA
(
LPCSTR
section
,
LPCSTR
entry
,
LPCSTR
string
,
LPCSTR
filename
)
{
BOOL
ret
;
BOOL
ret
=
FALSE
;
EnterCriticalSection
(
&
PROFILE_CritSect
);
if
(
!
PROFILE_Open
(
filename
))
{
ret
=
FALSE
;
}
else
if
(
!
section
)
{
ret
=
PROFILE_FlushFile
();
}
else
{
if
(
PROFILE_Open
(
filename
))
{
if
(
!
section
&&
!
entry
&&
!
string
)
PROFILE_ReleaseFile
();
/* always return FALSE in this case */
else
ret
=
PROFILE_SetString
(
section
,
entry
,
string
);
}
LeaveCriticalSection
(
&
PROFILE_CritSect
);
return
ret
;
}
...
...
@@ -1499,19 +1506,15 @@ BOOL16 WINAPI WritePrivateProfileStruct16 (LPCSTR section, LPCSTR key,
BOOL
WINAPI
WritePrivateProfileStructA
(
LPCSTR
section
,
LPCSTR
key
,
LPVOID
buf
,
UINT
bufsize
,
LPCSTR
filename
)
{
BOOL
ret
;
BOOL
ret
=
FALSE
;
if
(
!
section
&&
!
key
&&
!
buf
)
/* flush the cache */
return
WritePrivateProfileStringA
(
NULL
,
NULL
,
NULL
,
filename
);
EnterCriticalSection
(
&
PROFILE_CritSect
);
if
((
!
section
)
&&
(
!
key
)
&&
(
!
buf
))
{
/* flush the cache */
PROFILE_FlushFile
();
ret
=
FALSE
;
}
else
{
if
(
!
PROFILE_Open
(
filename
))
ret
=
FALSE
;
else
ret
=
PROFILE_SetString
(
section
,
key
,
buf
);
}
if
(
PROFILE_Open
(
filename
))
ret
=
PROFILE_SetString
(
section
,
key
,
buf
);
LeaveCriticalSection
(
&
PROFILE_CritSect
);
...
...
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