From 0a1ff035421d5f97675ad769a7fcdbc68399f3dc Mon Sep 17 00:00:00 2001 From: Johann Klähn Date: Tue, 8 Jan 2013 23:20:08 +0100 Subject: fix bug 788: behaviour of source_context for '-f -' `session_t::read_data` did not set context.pathname to `/dev/stdin` for the special case `-f -`. I chose to adjust `source_context` too as there is no sensible context if no file name is provided. --- src/error.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/error.cc') diff --git a/src/error.cc b/src/error.cc index 58339db7..d7e92daa 100644 --- a/src/error.cc +++ b/src/error.cc @@ -84,7 +84,7 @@ string source_context(const path& file, const string& prefix) { const std::streamoff len = end_pos - pos; - if (! len || file == path("/dev/stdin")) + if (! len || file == path("/dev/stdin") || file.empty()) return _(""); assert(len > 0); -- cgit v1.2.3