From 2e5d91f46dbc677cc101ffe6feb51415bc832118 Mon Sep 17 00:00:00 2001 From: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com> Date: Sun, 16 Jul 2023 22:21:47 +0100 Subject: [PATCH] Add whitespace stripping string to the regex match for [NoDelete] to idiot proof (#2364) * add whitespace stripping string to the regex match to idiot proof * updated changelog --- CHANGELOG.md | 2 ++ Wabbajack.Installer/AInstaller.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84f24a25..61e52708 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ * Added a check if Downloadpath is alongside Wabbajack.exe location, to match the install path check that already exists * Added check for identical download and install paths + * Fixed No Delete and NoDelete being handled by stripping whitespace before the regex, to idiotproof things a bit + #### Version - 3.1.0.0 - 5/7/2023 * Fixed Readme opening twice * Updated Text in the UI to better describe current app behavior diff --git a/Wabbajack.Installer/AInstaller.cs b/Wabbajack.Installer/AInstaller.cs index 44fb9d07..8f6c6482 100644 --- a/Wabbajack.Installer/AInstaller.cs +++ b/Wabbajack.Installer/AInstaller.cs @@ -534,8 +534,8 @@ public abstract class AInstaller return f; if (f.InFolder(profileFolder) && f.Parent.FileName == savePath) return f; - - if (NoDeleteRegex.IsMatch(f.ToString())) + var fNoSpaces = new string(f.ToString().Where(c => !Char.IsWhiteSpace(c)).ToArray()); + if (NoDeleteRegex.IsMatch(fNoSpaces)) return f; if (bsaPathsToNotBuild.Contains(f))