- fprintf (fp, "%s: In function `%s':\n", filename,
- demangle (functionname, 1));
+ if (last_file == NULL
+ || last_function == NULL
+ || strcmp (last_file, filename) != 0
+ || strcmp (last_function, functionname) != 0)
+ {
+ fprintf (fp, "%s: In function `%s':\n", filename,
+ demangle (functionname, 1));
+ if (last_file != NULL)
+ free (last_file);
+ last_file = buystring (filename);
+ if (last_function != NULL)
+ free (last_function);
+ last_function = buystring (functionname);
+ }
+ discard_last = false;