+static char *location_text(brief_location report_line)
+{
+ int j;
+ char *p;
+ int len;
+
+ /* Convert the location to a brief string.
+ (Some error messages need to report a secondary location.)
+ This uses the static buffer other_pos_buff. */
+
+ ErrorPosition errpos;
+ errpos.file_number = -1;
+ errpos.source = NULL;
+ errpos.line_number = 0;
+ errpos.main_flag = 0;
+ errpos.orig_source = NULL;
+ export_brief_location(report_line, &errpos);
+
+ j = errpos.file_number;
+ if (j <= 0 || j > total_files) p = errpos.source;
+ else p = InputFiles[j-1].filename;
+
+ if (!p && errpos.line_number == 0) {
+ /* Special case */
+ strcpy(other_pos_buff, "compiler setup");
+ return other_pos_buff;
+ }
+
+ if (!p) p = "";
+
+ len = 0;
+
+ if (!(errpos.main_flag)) {
+ snprintf(other_pos_buff+len, ERROR_BUFLEN-len,
+ "\"%s\", ", p);
+ len = strlen(other_pos_buff);
+ }
+ snprintf(other_pos_buff+len, ERROR_BUFLEN-len,
+ "line %d", errpos.line_number);
+
+ return other_pos_buff;
+}
+