Skip to content

Commit 6e59d56

Browse files
committed
[tree] Fix GetTreeFullPaths in case of protocol://
GetTreeFullPaths assumed that the first occurrence of ":/" was the separator between filename and tree name in strings such as "file.root:/dir/tree". However, the separator is the _last_ occurrence of ":/" -- e.g. if the file is read via a remote protocol, its name starts with "protocol://". This logic is of course still broken in case the name of the tree or the one of the directory that contains it contains ":/", we do not support that case. This fixes #10216.
1 parent 6ae602b commit 6e59d56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tree/tree/src/InternalTreeUtils.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ std::vector<std::string> GetTreeFullPaths(const TTree &tree)
212212
return {tree.GetName()};
213213
}
214214
std::string fullPath = treeDir->GetPath(); // e.g. "file.root:/dir"
215-
fullPath = fullPath.substr(fullPath.find(":/") + 1); // e.g. "/dir"
215+
fullPath = fullPath.substr(fullPath.find_last_of(":/") + 1); // e.g. "/dir"
216216
fullPath += "/";
217217
fullPath += tree.GetName(); // e.g. "/dir/tree"
218218
return {fullPath};

0 commit comments

Comments
 (0)