From 597293070cd4adf3b2cb742e0389fa62d67b5719 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 6 Jun 2025 13:29:40 +0200 Subject: [PATCH] fixed #13921 - do not perform additional addon lookups with absolute path --- lib/addoninfo.cpp | 4 ++++ test/cli/lookup_test.py | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/addoninfo.cpp b/lib/addoninfo.cpp index 82effa13834..ff046b00e5a 100644 --- a/lib/addoninfo.cpp +++ b/lib/addoninfo.cpp @@ -34,6 +34,10 @@ static std::string getFullPath(const std::string &fileName, const std::string &e if (Path::isFile(fileName)) return fileName; + const bool is_abs_path = Path::isAbsolute(fileName); + if (is_abs_path) + return ""; + const std::string exepath = Path::getPathFromFilename(exename); if (debug) std::cout << "looking for addon '" << (exepath + fileName) << "'" << std::endl; diff --git a/test/cli/lookup_test.py b/test/cli/lookup_test.py index dc28c6af35e..38cc8b943cc 100644 --- a/test/cli/lookup_test.py +++ b/test/cli/lookup_test.py @@ -623,15 +623,11 @@ def test_addon_lookup_absolute_notfound(tmpdir): addon_file = os.path.join(tmpdir, 'test.py') - exitcode, stdout, stderr, exe = cppcheck_ex(['--debug-lookup=addon', '--addon={}'.format(addon_file), test_file]) - exepath = os.path.dirname(exe) - exepath_sep = exepath + os.path.sep + exitcode, stdout, stderr = cppcheck(['--debug-lookup=addon', '--addon={}'.format(addon_file), test_file]) assert exitcode == 1, stdout if stdout else stderr lines = stdout.splitlines() assert lines == [ "looking for addon '{}'".format(addon_file), - "looking for addon '{}{}'".format(exepath_sep, addon_file), # TODO: should not perform this lookup - "looking for addon '{}addons/{}'".format(exepath_sep, addon_file), # TODO: should not perform this lookup 'Did not find addon {}'.format(addon_file) ]