Skip to content

Commit ccde058

Browse files
committed
Is #663 - Open context for gcc 2.95 port
1 parent a33520a commit ccde058

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/tidylib.c

+9-7
Original file line numberDiff line numberDiff line change
@@ -1135,14 +1135,16 @@ int tidyDocParseFile( TidyDocImpl* doc, ctmbstr filnam )
11351135
fin = fopen( filnam, "rb" );
11361136

11371137
#if PRESERVE_FILE_TIMES
1138-
struct stat sbuf = {0};
1139-
/* get last modified time */
1140-
TidyClearMemory( &doc->filetimes, sizeof(doc->filetimes) );
1141-
if ( fin && cfgBool(doc,TidyKeepFileTimes) &&
1142-
fstat(fileno(fin), &sbuf) != -1 )
11431138
{
1144-
doc->filetimes.actime = sbuf.st_atime;
1145-
doc->filetimes.modtime = sbuf.st_mtime;
1139+
struct stat sbuf = { 0 };
1140+
/* get last modified time */
1141+
TidyClearMemory(&doc->filetimes, sizeof(doc->filetimes));
1142+
if (fin && cfgBool(doc, TidyKeepFileTimes) &&
1143+
fstat(fileno(fin), &sbuf) != -1)
1144+
{
1145+
doc->filetimes.actime = sbuf.st_atime;
1146+
doc->filetimes.modtime = sbuf.st_mtime;
1147+
}
11461148
}
11471149
#endif
11481150

0 commit comments

Comments
 (0)