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:
@@ -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.
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user