From b2e8b66eaef5cc8e69088784ed86e6fb50e9e9ac Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 1 Apr 2021 11:20:13 -0700 Subject: [PATCH] Fix SmartE overmatching --- BurnOutSharp/ProtectionType/SmartE.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/BurnOutSharp/ProtectionType/SmartE.cs b/BurnOutSharp/ProtectionType/SmartE.cs index a8974f8a..c11c30cd 100644 --- a/BurnOutSharp/ProtectionType/SmartE.cs +++ b/BurnOutSharp/ProtectionType/SmartE.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.IO; using BurnOutSharp.Matching; namespace BurnOutSharp.ProtectionType @@ -26,8 +27,8 @@ namespace BurnOutSharp.ProtectionType // TODO: Verify if these are OR or AND var matchers = new List { - new PathMatchSet(new PathMatch("00001.TMP", useEndsWith: true), "SmartE"), - new PathMatchSet(new PathMatch("00002.TMP", useEndsWith: true), "SmartE"), + new PathMatchSet(new PathMatch($"{Path.DirectorySeparatorChar}00001.TMP", useEndsWith: true), "SmartE"), + new PathMatchSet(new PathMatch($"{Path.DirectorySeparatorChar}00002.TMP", useEndsWith: true), "SmartE"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); @@ -38,8 +39,8 @@ namespace BurnOutSharp.ProtectionType { var matchers = new List { - new PathMatchSet(new PathMatch("00001.TMP", useEndsWith: true), "SmartE"), - new PathMatchSet(new PathMatch("00002.TMP", useEndsWith: true), "SmartE"), + new PathMatchSet(new PathMatch($"{Path.DirectorySeparatorChar}00001.TMP", useEndsWith: true), "SmartE"), + new PathMatchSet(new PathMatch($"{Path.DirectorySeparatorChar}00002.TMP", useEndsWith: true), "SmartE"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true);