summaryrefslogtreecommitdiff
path: root/src/expand
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-01-15 17:27:32 +0800
committerJohn Hodge <tpg@mutabah.net>2017-01-15 17:27:32 +0800
commit6013db4d24e59d4827bdc2188852d58867f1bed6 (patch)
tree133ac996c8c27b838a1fa6102aea5b2551f3dafb /src/expand
parentc10e5de8a6134068b2e0cfd119a7b5ee980214c9 (diff)
downloadmrust-6013db4d24e59d4827bdc2188852d58867f1bed6.tar.gz
Expand include! - Support for absolute paths
Diffstat (limited to 'src/expand')
-rw-r--r--src/expand/include.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/expand/include.cpp b/src/expand/include.cpp
index c41cc03b..a6eb9fe1 100644
--- a/src/expand/include.cpp
+++ b/src/expand/include.cpp
@@ -30,7 +30,10 @@ namespace {
::std::string get_path_relative_to(const ::std::string& base_path, ::std::string path)
{
- if( base_path.size() == 0 ) {
+ if( path[0] == '/' ) {
+ return path;
+ }
+ else if( base_path.size() == 0 ) {
return path;
}
else if( base_path[base_path.size()-1] == '/' ) {