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/session.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/session.cc') diff --git a/src/session.cc b/src/session.cc index b6153203..f047a540 100644 --- a/src/session.cc +++ b/src/session.cc @@ -143,7 +143,7 @@ std::size_t session_t::read_data(const string& master_account) } foreach (const path& pathname, HANDLER(file_).data_files) { - if (pathname == "-") { + if (pathname == "-" || pathname == "/dev/stdin") { // To avoid problems with stdin and pipes, etc., we read the entire // file in beforehand into a memory buffer, and then parcel it out // from there. -- cgit v1.2.3