error messages. Make sure each call to agmemread resets the line number
to 1 and the file name to NULL. If the input contains cpp line directive,
another run of agmemread with errors would report them incorrectly.
In addition, the gvNextInputGraph in common/input.s was not resetting the
the file name in the case that the new FILE* happened to use the same memory
as the previous FILE*.
disc.mem = &AgMemDisc;
disc.id = &AgIdDisc;
- disc.io = &memIoDisc;
+ disc.io = &memIoDisc;
+ /* Null out filename and reset line number
+ * The name may have been set with a ppDirective, and
+ * we want to reset line_num.
+ */
+ agsetfile(NULL);
g = agread (&rdr, &disc);
return g;
}
}
if (fp != stdin)
fclose (fp);
- fp = NULL;
+ oldfp = fp = NULL;
gidx = 0;
}
return g;