diff options
-rw-r--r-- | src/textual.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/textual.cc b/src/textual.cc index ca7aa190..1d8de046 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -608,7 +608,17 @@ void instance_t::xact_directive(char * line, std::streamsize len) void instance_t::include_directive(char * line) { - path filename(line); + path filename; + + if (line[0] != '/' && line[0] != '\\' && line[0] != '~') { + string::size_type pos = pathname.string().rfind('/'); + if (pos == string::npos) + pos = pathname.string().rfind('\\'); + if (pos != string::npos) + filename = path(string(pathname.string(), 0, pos + 1)) / line; + } else { + filename = line; + } filename = resolve_path(filename); |