diff --git a/SabreTools.Helper/Objects/DATFromDir.cs b/SabreTools.Helper/Objects/DATFromDir.cs index 22604c5b..d9012506 100644 --- a/SabreTools.Helper/Objects/DATFromDir.cs +++ b/SabreTools.Helper/Objects/DATFromDir.cs @@ -320,11 +320,19 @@ namespace SabreTools // Cue to delete the file if it's a copy if (_copyFiles) { - try + int i = 0; + while (File.Exists(newItem) && i < 50) { - Directory.Delete(Path.GetDirectoryName(newItem), true); + try + { + Directory.Delete(Path.GetDirectoryName(newItem), true); + } + catch + { + i++; + } } - catch + if (File.Exists(newItem)) { _clean.Add(newItem); } diff --git a/SabreTools.Helper/Tools/Style.cs b/SabreTools.Helper/Tools/Style.cs index 77080e7a..142884d4 100644 --- a/SabreTools.Helper/Tools/Style.cs +++ b/SabreTools.Helper/Tools/Style.cs @@ -441,11 +441,13 @@ namespace SabreTools.Helper /// public static int CompareNumeric(string s, string other) { - if ((s == null || s.Replace(" ", string.Empty).Length == 0) && (other != null && other.Replace(" ", string.Empty).Length > 0)) + if ((s == null || s.Replace(" ", string.Empty).Length == 0) + && (other != null && other.Replace(" ", string.Empty).Length > 0)) { return -1; } - if ((s != null && s.Replace(" ", string.Empty).Length > 0) && (other == null || other.Replace(" ", string.Empty).Length == 0)) + if ((s != null && s.Replace(" ", string.Empty).Length > 0) + && (other == null || other.Replace(" ", string.Empty).Length == 0)) { return 1; }