1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Checkpointing a possible insanity-fix to Ownership.

This commit is contained in:
Patrick LeBlanc
2019-08-19 13:37:10 -05:00
parent 2c2cb219f2
commit bba8009c75

View File

@ -75,7 +75,7 @@ bf::path Ownership::get(const bf::path &p)
{
bf::path ret, prefix, normalizedPath(p);
bf::path::const_iterator pit;
uint i;
uint i, levels;
normalizedPath.normalize();
//cerr << "Ownership::get() param = " << p.string() << endl;
@ -86,13 +86,15 @@ bf::path Ownership::get(const bf::path &p)
if (pit != normalizedPath.end())
prefix = *pit;
//cerr << "prefix is " << prefix.string() << endl;
for (; pit != normalizedPath.end(); ++pit)
for (levels = 0; pit != normalizedPath.end(); ++levels, ++pit)
ret /= *pit;
if (ret.empty())
{
//cerr << "returning ''" << endl;
return ret;
}
else if (levels == 1)
throw runtime_error("Ownership: given path " + p.string() + " does not have minimum number of directories");
}
else
{