From 8d6fd18e96707e7f86fcf7ef647ee75fd77199eb Mon Sep 17 00:00:00 2001 From: fabinsch Date: Wed, 7 Sep 2022 11:51:45 +0200 Subject: [PATCH] parser/utils: fix check for relative path --- src/parsers/utils.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parsers/utils.hpp b/src/parsers/utils.hpp index f662b69106..8139e13ba7 100644 --- a/src/parsers/utils.hpp +++ b/src/parsers/utils.hpp @@ -67,6 +67,7 @@ namespace pinocchio const std::string separator("://"); const std::size_t pos_separator = string.find(separator); + bf::path string_path(string); if (pos_separator != std::string::npos) { @@ -99,7 +100,7 @@ namespace pinocchio throw std::invalid_argument(exception_message); } } - else if (string.substr(0,2).compare("./") == 0) + else if (string_path.is_relative()) { // handle the case where a relative mesh path is specified without using //package for (std::size_t i = 0; i < package_dirs.size(); ++i)