summaryrefslogtreecommitdiff
path: root/cli/generator.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-01-28 07:24:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-01-28 07:24:22 +0200
commit648b616c86e05c74b9ad25ad2bb5e5adf4172619 (patch)
tree16daf0db543e17b2e5fd90ac65d33f2de563d896 /cli/generator.cxx
parent6d52ac69e940a6be6c15c5c6f84a183bf56899c8 (diff)
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.
Diffstat (limited to 'cli/generator.cxx')
-rw-r--r--cli/generator.cxx4
1 files changed, 3 insertions, 1 deletions
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;
}
}
}