We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7cfba76 commit 332de49Copy full SHA for 332de49
pluginlib/include/pluginlib/class_loader_imp.hpp
@@ -597,11 +597,13 @@ ClassLoader<T>::getPackageFromPluginXMLFilePath(const std::string & plugin_xml_f
597
return extractPackageNameFromPackageXML(package_file_path);
598
}
599
600
- // Recursive case - hop one folder up
+ // Recursive case - hop one folder up and store current parent
601
+ // parent_path() returns the current path if we reached the root.
602
+ p = parent;
603
parent = parent.parent_path();
604
605
// Base case - reached root and cannot find what we're looking for
- if (parent.string().empty()) {
606
+ if (parent.string().empty() || (p == parent)) {
607
return "";
608
609
0 commit comments