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 -' --- test/regress/BF3C1F82-2.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/regress/BF3C1F82-2.test (limited to 'test/regress/BF3C1F82-2.test') diff --git a/test/regress/BF3C1F82-2.test b/test/regress/BF3C1F82-2.test new file mode 100644 index 00000000..453151ce --- /dev/null +++ b/test/regress/BF3C1F82-2.test @@ -0,0 +1,12 @@ +; Check that include directives are relative for "-f /dev/stdin" +include non-existent-ledger-file-BF3C1F82 +test -f - reg -> 1 +__ERROR__ +While parsing file "", line 2: +Error: File to include was not found: "./non-existent-ledger-file-BF3C1F82" +end test +test -f /dev/stdin reg -> 1 +__ERROR__ +While parsing file "", line 2: +Error: File to include was not found: "./non-existent-ledger-file-BF3C1F82" +end test -- cgit v1.2.3