Commit 1a7b77b6 authored by Marc Vef's avatar Marc Vef
Browse files

Merge branch 'bugfix_get_dirents' into 'master'

bugfix: wrong termination condition on Metadata::get_dirents

See merge request zdvresearch_bsc/adafs!70
parents 6e51804c 83c78bc8
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -124,10 +124,14 @@ std::vector<std::pair<std::string, bool>> MetadataDB::get_dirents(const std::str

    for(it->Seek(root_path);
            it->Valid() &&
            it->key().starts_with(root_path) &&
            it->key().size() != root_path.size();
            it->key().starts_with(root_path);
        it->Next()){

        if(it->key().size() == root_path.size()) {
            //we skip this path cause it is exactly the root_path
            continue;
        }

        /***** Get File name *****/
        auto name = it->key().ToString();
        if(name.find_first_of('/', root_path.size()) != std::string::npos){