diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-05-26 15:58:30 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-05-26 15:58:30 +0200 |
commit | 6e9dfefc8b353ce2cae650e6d3d68e38fcd12a8a (patch) | |
tree | a09faaa0d19f424be41c92477890b535cbbc0694 /bdep/diagnostics.cxx | |
parent | 8d841f1f893413518b5aa1894e96f1decee91808 (diff) |
Don't print empty location, zero line/column
Diffstat (limited to 'bdep/diagnostics.cxx')
-rw-r--r-- | bdep/diagnostics.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/bdep/diagnostics.cxx b/bdep/diagnostics.cxx index 0861056..e1f5f6a 100644 --- a/bdep/diagnostics.cxx +++ b/bdep/diagnostics.cxx @@ -51,7 +51,20 @@ namespace bdep void location_prologue_base:: operator() (const diag_record& r) const { - r << loc_.file << ':' << loc_.line << ':' << loc_.column << ": "; + if (!loc_.empty ()) + { + r << loc_.file << ':'; + + if (loc_.line != 0) + { + r << loc_.line << ':'; + + if (loc_.column != 0) + r << loc_.column << ':'; + } + + r << ' '; + } if (type_ != nullptr) r << type_ << ": "; |