From f30676cbc73b9ee5135f93a3567753a89d684831 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Mon, 14 Aug 2023 14:10:45 +0100 Subject: [PATCH] Invert condition Rebased to account for upstream normalising slashes to replace forward slashes with backslashes, simplifying the part that needed to check for both variants. Perhaps if it'd been like that in the first place, I wouldn't have made the mistake that made the original version of this commit necessary. --- components/misc/resourcehelpers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/misc/resourcehelpers.cpp b/components/misc/resourcehelpers.cpp index 762a8b88d2..32f65872c7 100644 --- a/components/misc/resourcehelpers.cpp +++ b/components/misc/resourcehelpers.cpp @@ -72,8 +72,8 @@ std::string Misc::ResourceHelpers::correctResourcePath(std::string_view topLevel bool needsPrefix = true; for (std::string_view alternativeDirectory : alternativeDirectories) { - if (!correctedPath.starts_with(alternativeDirectory) || correctedPath.size() <= alternativeDirectory.size() - || correctedPath[alternativeDirectory.size()] != '\\') + if (correctedPath.starts_with(alternativeDirectory) && correctedPath.size() > alternativeDirectory.size() + && correctedPath[alternativeDirectory.size()] == '\\') { needsPrefix = false; break;