Is #663 - Open context for gcc 2.95 port

This commit is contained in:
Geoff McLane 2017-12-25 03:26:53 +01:00
parent a33520ad85
commit ccde058772
1 changed files with 9 additions and 7 deletions

View File

@ -1135,14 +1135,16 @@ int tidyDocParseFile( TidyDocImpl* doc, ctmbstr filnam )
fin = fopen( filnam, "rb" );
#if PRESERVE_FILE_TIMES
struct stat sbuf = {0};
/* get last modified time */
TidyClearMemory( &doc->filetimes, sizeof(doc->filetimes) );
if ( fin && cfgBool(doc,TidyKeepFileTimes) &&
fstat(fileno(fin), &sbuf) != -1 )
{
doc->filetimes.actime = sbuf.st_atime;
doc->filetimes.modtime = sbuf.st_mtime;
struct stat sbuf = { 0 };
/* get last modified time */
TidyClearMemory(&doc->filetimes, sizeof(doc->filetimes));
if (fin && cfgBool(doc, TidyKeepFileTimes) &&
fstat(fileno(fin), &sbuf) != -1)
{
doc->filetimes.actime = sbuf.st_atime;
doc->filetimes.modtime = sbuf.st_mtime;
}
}
#endif