Support include-ing of relative pathnames

This commit is contained in:
John Wiegley 2009-11-10 01:06:04 -05:00
parent 009b257397
commit 16a2a16097

View file

@ -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);