From 75ad5283b4e902ef3441605d23e770f6e9538b35 Mon Sep 17 00:00:00 2001 From: Andy MacGregor Date: Wed, 27 Sep 2023 13:56:11 -0400 Subject: [PATCH] Fix #12015 by adding pid to filelist name --- lib/cppcheck.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 7d198f582f3..b064853ee3e 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -383,7 +383,8 @@ static std::vector executeAddon(const AddonInfo &addonInfo, if (!premiumArgs.empty() && !addonInfo.executable.empty()) args += " " + premiumArgs; - const std::string fileArg = (endsWith(file, FILELIST, sizeof(FILELIST)-1) ? " --file-list " : " ") + cmdFileName(file); + const bool is_file_list = (file.find(FILELIST) != std::string::npos); + const std::string fileArg = (is_file_list ? " --file-list " : " ") + cmdFileName(file); args += fileArg; std::string result; @@ -1492,7 +1493,7 @@ void CppCheck::executeAddons(const std::vector& files) std::string fileList; if (files.size() >= 2 || endsWith(files[0], ".ctu-info")) { - fileList = Path::getPathFromFilename(files[0]) + FILELIST; + fileList = Path::getPathFromFilename(files[0]) + FILELIST + std::to_string(getPid()); filesDeleter.addFile(fileList); std::ofstream fout(fileList); for (const std::string& f: files)