From 3fe2ef59566ef679d9de58e5f9454b7443d9153a Mon Sep 17 00:00:00 2001 From: Johann Klähn Date: Thu, 17 Jan 2013 12:18:58 +0100 Subject: change handling of standard input For `-f /dev/stdin`, the `pathname` of the parsing context will be empty as for any other streamed input. `instance_t::include_directive` did not work as expected for `-f /dev/stdin` and relative file names. One would expect them to be relative to the current directory rather than `/dev`. This will lead to `While parsing file ""` messages. This could be adjusted to read `While parsing standard input`, but maybe it's not worth the special cases. This commit also fixes bug 788: behaviour of source_context for '-f -' --- src/item.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/item.cc') diff --git a/src/item.cc b/src/item.cc index 362fac7f..4e2a487c 100644 --- a/src/item.cc +++ b/src/item.cc @@ -582,8 +582,8 @@ string item_context(const item_t& item, const string& desc) std::ostringstream out; - if (item.pos->pathname == path("/dev/stdin")) { - out << desc << _(" from standard input:"); + if (item.pos->pathname.empty()) { + out << desc << _(" from streamed input:"); return out.str(); } -- cgit v1.2.3