Accept paths without ancestors

This commit is contained in:
Raúl Marín 2023-07-18 11:00:13 +02:00
parent 496aaf58c8
commit ed4c560e33

View File

@ -357,6 +357,8 @@ void ZooKeeper::createAncestors(const std::string & path)
std::vector<std::string> pending_nodes;
size_t last_pos = path.rfind('/');
if (last_pos == std::string::npos || last_pos == 0)
return;
std::string current_node = path.substr(0, last_pos);
while (true)