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

View file

@ -1135,14 +1135,16 @@ int tidyDocParseFile( TidyDocImpl* doc, ctmbstr filnam )
fin = fopen( filnam, "rb" ); fin = fopen( filnam, "rb" );
#if PRESERVE_FILE_TIMES #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; struct stat sbuf = { 0 };
doc->filetimes.modtime = sbuf.st_mtime; /* 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 #endif