Support include-ing of relative pathnames
This commit is contained in:
parent
009b257397
commit
16a2a16097
1 changed files with 11 additions and 1 deletions
|
|
@ -608,7 +608,17 @@ void instance_t::xact_directive(char * line, std::streamsize len)
|
||||||
|
|
||||||
void instance_t::include_directive(char * line)
|
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);
|
filename = resolve_path(filename);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue