diff --git a/components/misc/resourcehelpers.cpp b/components/misc/resourcehelpers.cpp index b602001913..7386dceb9f 100644 --- a/components/misc/resourcehelpers.cpp +++ b/components/misc/resourcehelpers.cpp @@ -67,10 +67,10 @@ std::string Misc::ResourceHelpers::correctResourcePath( // Handle top level directory bool needsPrefix = true; - for (std::string_view alternativeDirectory : topLevelDirectories) + for (std::string_view potentialTopLevelDirectory : topLevelDirectories) { - if (correctedPath.starts_with(alternativeDirectory) && correctedPath.size() > alternativeDirectory.size() - && correctedPath[alternativeDirectory.size()] == '\\') + if (correctedPath.starts_with(potentialTopLevelDirectory) && correctedPath.size() > potentialTopLevelDirectory.size() + && correctedPath[potentialTopLevelDirectory.size()] == '\\') { needsPrefix = false; break;