sqlite: complete symlinks so that the proper relative path can be fetched for an attached db reference - closes #859

This commit is contained in:
Dane Springmeyer 2011-09-01 23:23:29 +00:00
parent 1dc3d279c1
commit aa9bdf0d5a

View file

@ -174,6 +174,13 @@ void sqlite_datasource::parse_attachdb(std::string const& attachdb) {
// It is a relative path. Fix it.
if (!child_path.has_root_directory() && !child_path.has_root_name()) {
boost::filesystem::path absolute_path(dataset_name_);
// support symlinks
if (boost::filesystem::is_symlink(absolute_path))
{
absolute_path = boost::filesystem::read_symlink(absolute_path);
}
#if (BOOST_FILESYSTEM_VERSION == 3)
filename = boost::filesystem::absolute(absolute_path.parent_path()/filename).string();
#else