aboutsummaryrefslogtreecommitdiff
path: root/bdep/diagnostics.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bdep/diagnostics.cxx')
-rw-r--r--bdep/diagnostics.cxx15
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_ << ": ";