summaryrefslogtreecommitdiff
path: root/src/context.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/context.h')
-rw-r--r--src/context.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/context.h b/src/context.h
index 09734b3e..7373be39 100644
--- a/src/context.h
+++ b/src/context.h
@@ -112,16 +112,16 @@ inline parse_context_t open_for_reading(const path& pathname,
const path& cwd)
{
path filename = resolve_path(pathname);
-
+#if BOOST_VERSION >= 104600 && BOOST_FILESYSTEM_VERSION >= 3
+ filename = filesystem::absolute(filename, cwd);
+#else
+ filename = filesystem::complete(filename, cwd);
+#endif
if (! exists(filename))
throw_(std::runtime_error,
_f("Cannot read journal file %1%") % filename);
-#if BOOST_VERSION >= 104600 && BOOST_FILESYSTEM_VERSION >= 3
- path parent(filesystem::absolute(pathname, cwd).parent_path());
-#else
- path parent(filesystem::complete(pathname, cwd).parent_path());
-#endif
+ path parent(pathname.parent_path());
shared_ptr<std::istream> stream(new ifstream(filename));
parse_context_t context(stream, parent);
context.pathname = filename;