+2016-03-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ Jim MacArthur <jim.macarthur@codethink.co.uk>
+
+ PR fortran/69043
+ * scanner.c (load_file): Check that included file is regular.
+
2016-03-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Harold Anlauf <anlauf@gmx.de>
FILE *input;
int len, line_len;
bool first_line;
+ struct stat st;
+ int stat_result;
const char *filename;
/* If realfilename and displayedname are different and non-null then
surely realfilename is the preprocessed form of
}
else
input = gfc_open_file (realfilename);
+
if (input == NULL)
{
gfc_error_now ("Can't open file %qs", filename);
current_file->filename, current_file->line, filename);
return false;
}
+ stat_result = stat (realfilename, &st);
+ if (stat_result == 0 && !(st.st_mode & S_IFREG))
+ {
+ fprintf (stderr, "%s:%d: Error: Included path '%s'"
+ " is not a regular file\n",
+ current_file->filename, current_file->line, filename);
+ fclose (input);
+ return false;
+ }
}
/* Load the file.
+2016-03-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/69043
+ * gfortran.dg/include_9.f90: New test.
+
2016-03-13 Dominique d'Humieres <dominiq@lps.ens.fr>
PR fortran/45076