Commit 6b1a9311 authored by Alexandre Julliard's avatar Alexandre Julliard

Don't try to get the file time if the file wasn't found.

parent 9c141d4a
...@@ -747,8 +747,6 @@ static BOOL PROFILE_Open( LPCWSTR filename ) ...@@ -747,8 +747,6 @@ static BOOL PROFILE_Open( LPCWSTR filename )
return FALSE; return FALSE;
} }
GetFileTime(hFile, NULL, NULL, &LastWriteTime);
for(i=0;i<N_CACHED_PROFILES;i++) for(i=0;i<N_CACHED_PROFILES;i++)
{ {
if ((MRUProfile[i]->filename && !strcmpW( buffer, MRUProfile[i]->filename ))) if ((MRUProfile[i]->filename && !strcmpW( buffer, MRUProfile[i]->filename )))
...@@ -762,6 +760,7 @@ static BOOL PROFILE_Open( LPCWSTR filename ) ...@@ -762,6 +760,7 @@ static BOOL PROFILE_Open( LPCWSTR filename )
MRUProfile[j]=MRUProfile[j-1]; MRUProfile[j]=MRUProfile[j-1];
CurProfile=tempProfile; CurProfile=tempProfile;
} }
GetFileTime(hFile, NULL, NULL, &LastWriteTime);
if(memcmp(&CurProfile->LastWriteTime, &LastWriteTime, sizeof(FILETIME))) if(memcmp(&CurProfile->LastWriteTime, &LastWriteTime, sizeof(FILETIME)))
TRACE("(%s): already opened (mru=%d)\n", TRACE("(%s): already opened (mru=%d)\n",
debugstr_w(buffer), i ); debugstr_w(buffer), i );
...@@ -793,8 +792,8 @@ static BOOL PROFILE_Open( LPCWSTR filename ) ...@@ -793,8 +792,8 @@ static BOOL PROFILE_Open( LPCWSTR filename )
if (hFile != INVALID_HANDLE_VALUE) if (hFile != INVALID_HANDLE_VALUE)
{ {
CurProfile->section = PROFILE_Load(hFile, &CurProfile->encoding); CurProfile->section = PROFILE_Load(hFile, &CurProfile->encoding);
GetFileTime(hFile, NULL, NULL, &CurProfile->LastWriteTime);
CloseHandle(hFile); CloseHandle(hFile);
memcpy(&CurProfile->LastWriteTime, &LastWriteTime, sizeof(FILETIME));
} }
else 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