diff options
-rw-r--r-- | src/expand/include.cpp | 5 | ||||
-rw-r--r-- | src/parse/lex.cpp | 2 |
2 files changed, 5 insertions, 2 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] == '/' ) { diff --git a/src/parse/lex.cpp b/src/parse/lex.cpp index 5657c908..4e5b4c2d 100644 --- a/src/parse/lex.cpp +++ b/src/parse/lex.cpp @@ -25,7 +25,7 @@ Lexer::Lexer(const ::std::string& filename): { if( !m_istream.is_open() ) { - throw ::std::runtime_error("Unable to open file"); + throw ::std::runtime_error("Unable to open file '" + filename + "'"); } // Consume the BOM if( this->getc_byte() == '\xef' ) |