Skip to content

Commit

Permalink
check abs path
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 committed Feb 28, 2024
1 parent f092180 commit e973d80
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*
*/
#include <filesystem>
#include <limits>
#include <string>
#include <utility>
Expand Down Expand Up @@ -390,7 +391,9 @@ std::string resolveURI(const std::string &_inputURI,
if (_config.StoreResolvedURIs())
{
std::string sep("://");
if (!_searchPaths.empty() && _inputURI.find(sep) == std::string::npos)
if (!_searchPaths.empty() &&
_inputURI.find(sep) == std::string::npos &&
!std::filesystem::path(_inputURI).is_absolute())
{
for (const auto &sp : _searchPaths)
{
Expand Down

0 comments on commit e973d80

Please sign in to comment.