Commit 14f9b844 authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed profile cache flushing when no filename is specified (reported

by Mike Hearn).
parent 9ee0586c
......@@ -1421,14 +1421,15 @@ BOOL WINAPI WritePrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
RtlEnterCriticalSection( &PROFILE_CritSect );
if (PROFILE_Open( filename ))
{
if (!section && !entry && !string) /* documented "file flush" case */
{
PROFILE_FlushFile();
PROFILE_ReleaseFile(); /* always return FALSE in this case */
if (!filename || PROFILE_Open( filename ))
{
if (CurProfile) PROFILE_ReleaseFile(); /* always return FALSE in this case */
}
}
else {
else if (PROFILE_Open( filename ))
{
if (!section) {
FIXME("(NULL?,%s,%s,%s)?\n",
debugstr_w(entry), debugstr_w(string), debugstr_w(filename));
......@@ -1437,7 +1438,6 @@ BOOL WINAPI WritePrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
PROFILE_FlushFile();
}
}
}
RtlLeaveCriticalSection( &PROFILE_CritSect );
return ret;
......@@ -1481,10 +1481,15 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section,
RtlEnterCriticalSection( &PROFILE_CritSect );
if (PROFILE_Open( filename )) {
if (!section && !string)
PROFILE_ReleaseFile(); /* always return FALSE in this case */
else if (!string) {/* delete the named section*/
{
if (!filename || PROFILE_Open( filename ))
{
if (CurProfile) PROFILE_ReleaseFile(); /* always return FALSE in this case */
}
}
else if (PROFILE_Open( filename )) {
if (!string) {/* delete the named section*/
ret = PROFILE_SetString(section,NULL,NULL, FALSE);
PROFILE_FlushFile();
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment