- fprintf (out, "-%s:%d.%d",
- quotearg_n_style (3, escape_quoting_style, loc.end.file),
- loc.end.line, end_col);
- else if (loc.start.line < loc.end.line)
- fprintf (out, "-%d.%d", loc.end.line, end_col);
- else if (loc.start.column < end_col)
- fprintf (out, "-%d", end_col);
+ {
+ res += fprintf (out, "-%s",
+ quotearg_n_style (3, escape_quoting_style,
+ loc.end.file));
+ if (0 <= loc.end.line)
+ {
+ res += fprintf(out, ":%d", loc.end.line);
+ if (0 <= end_col)
+ res += fprintf (out, ".%d", end_col);
+ }
+ }
+ else if (0 <= loc.end.line)
+ {
+ if (loc.start.line < loc.end.line)
+ {
+ res += fprintf (out, "-%d", loc.end.line);
+ if (0 <= end_col)
+ res += fprintf (out, ".%d", end_col);
+ }
+ else if (0 <= end_col && loc.start.column < end_col)
+ res += fprintf (out, "-%d", end_col);
+ }
+
+ return res;