rcldb::getSubDocs() (called from GUI show subdocs) was returning too many results because the parent/child ipath test was flawed

This commit is contained in:
Jean-Francois Dockes
2015-11-03 08:40:13 +01:00
parent a3a7081a7f
commit f70c92c629
3 changed files with 27 additions and 5 deletions
+6
View File
@@ -102,6 +102,12 @@ string FileInterner::getLastIpathElt(const string& ipath)
}
}
bool FileInterner::ipathContains(const string& parent, const string& child)
{
return child.find(parent) == 0 &&
child.find(cstr_isep, parent.size()) == parent.size();
}
// Constructor: identify the input file, possibly create an
// uncompressed temporary copy, and create the top filter for the
// uncompressed file type.
+3
View File
@@ -206,6 +206,9 @@ class FileInterner {
/** Return last element in ipath, like basename */
static std::string getLastIpathElt(const std::string& ipath);
/** Check that 2nd param is child of first */
static bool ipathContains(const std::string& parent,
const std::string& child);
/**
* Build sig for doc coming from rcldb. This is here because we know how
* to query the right backend. Used to check up-to-dateness at query time */