From 648b616c86e05c74b9ad25ad2bb5e5adf4172619 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 28 Jan 2016 07:24:22 +0200 Subject: Add support for file expansion in prologue/epilogue files This is similar to variable expansion ($name$) except here we detect if the name starts with ./ or ../ and treat it as a path relative to the prologue/ epilogue file. --- cli/generator.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cli/generator.cxx') diff --git a/cli/generator.cxx b/cli/generator.cxx index 486c793..5964c25 100644 --- a/cli/generator.cxx +++ b/cli/generator.cxx @@ -94,12 +94,14 @@ namespace ifstream ifs; open (ifs, file); + path d (path (file).directory ()); + // getline() will set the failbit if it failed to extract anything, // not even the delimiter and eofbit if it reached eof before seeing // the delimiter. // for (string s; getline (ifs, s); ) - os << context::substitute (s, u) << endl; + os << context::substitute (s, u, &d) << endl; } } } -- cgit v1.1