+2008-07-19 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/36342
+ * scanner.c (load_file): Add argument to destinguish between
+ true filename and displayed filename.
+ (include_line,gfc_new_file): Adapt accordingly.
+
2008-07-19 Tobias Burnus <burnus@net-b.de>
* check.c (gfc_check_cshift,gfc_check_eoshift,gfc_check_unpack): Add rank
}
-static try load_file (const char *, bool);
+static try load_file (const char *, const char *, bool);
/* include_line()-- Checks a line buffer to see if it is an include
line. If so, we call load_file() recursively to load the included
read by anything else. */
filename = gfc_widechar_to_char (begin, -1);
- load_file (filename, false);
+ load_file (filename, NULL, false);
gfc_free (filename);
return true;
}
/* Load a file into memory by calling load_line until the file ends. */
static try
-load_file (const char *filename, bool initial)
+load_file (const char *realfilename, const char *displayedname, bool initial)
{
gfc_char_t *line;
gfc_linebuf *b;
FILE *input;
int len, line_len;
bool first_line;
+ const char *filename;
+
+ filename = displayedname ? displayedname : realfilename;
for (f = current_file; f; f = f->up)
if (strcmp (filename, f->filename) == 0)
gfc_src_file = NULL;
}
else
- input = gfc_open_file (filename);
+ input = gfc_open_file (realfilename);
if (input == NULL)
{
gfc_error_now ("Can't open file '%s'", filename);
}
else
{
- input = gfc_open_included_file (filename, false, false);
+ input = gfc_open_included_file (realfilename, false, false);
if (input == NULL)
{
gfc_error_now ("Can't open included file '%s'", filename);
{
result = gfc_cpp_preprocess (gfc_source_file);
if (!gfc_cpp_preprocess_only ())
- result = load_file (gfc_cpp_temporary_file (), true);
+ result = load_file (gfc_cpp_temporary_file (), gfc_source_file, true);
}
else
- result = load_file (gfc_source_file, true);
+ result = load_file (gfc_source_file, NULL, true);
gfc_current_locus.lb = line_head;
gfc_current_locus.nextc = (line_head == NULL) ? NULL : line_head->line;