Browse Source

Fixed crash when filesystem::get_relative_path was called and current path was deleted

merge-requests/365/head
eidheim 9 years ago
parent
commit
bb83c9fde9
  1. 8
      src/filesystem.cc

8
src/filesystem.cc

@ -202,11 +202,7 @@ boost::filesystem::path filesystem::get_canonical_path(const boost::filesystem::
boost::filesystem::path filesystem::get_relative_path(const boost::filesystem::path &path, const boost::filesystem::path &base) noexcept {
boost::filesystem::path relative_path;
boost::system::error_code ec;
#if BOOST_VERSION>=106000
relative_path=boost::filesystem::relative(path, base, ec);
if(ec)
return boost::filesystem::path();
#else
if(std::distance(path.begin(), path.end())<std::distance(base.begin(), base.end()))
return boost::filesystem::path();
@ -220,6 +216,6 @@ boost::filesystem::path filesystem::get_relative_path(const boost::filesystem::p
}
for(;path_it!=path.end();++path_it)
relative_path/=*path_it;
#endif
return relative_path;
}

Loading…
Cancel
Save