- if (! fgets (file, sizeof(file), output))
- goto fallback;
-
- i++;
-
- for (p = func; *p != '\n' && *p != '\r'; p++)
- ;
-
- *p = '\0';
-
- /* Try to recognize the internal libgfortran functions. */
- if (strncasecmp (func, "*_gfortran", 10) == 0
- || strncasecmp (func, "_gfortran", 9) == 0
- || strcmp (func, "main") == 0 || strcmp (func, "_start") == 0
- || strcmp (func, "_gfortrani_backtrace_handler") == 0)
- continue;
-
- if (local_strcasestr (str[i], "libgfortran.so") != NULL
- || local_strcasestr (str[i], "libgfortran.dylib") != NULL
- || local_strcasestr (str[i], "libgfortran.a") != NULL)
- continue;
-
- /* If we only have the address, use the glibc backtrace. */
- if (func[0] == '?' && func[1] == '?' && file[0] == '?'
- && file[1] == '?')
- {
- estr_write (" + ");
- estr_write (str[i]);
- estr_write ("\n");
- continue;
- }
-
- /* Extract the line number. */
- for (end = NULL, p = file; *p; p++)
- if (*p == ':')
- end = p;
- if (end != NULL)
- {
- *end = '\0';
- line = atoi (++end);
- }
- else
- line = -1;
-
- if (strcmp (func, "MAIN__") == 0)
- estr_write (" + in the main program\n");
- else