mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Merge pull request #1191 from LostDragonist/ignoredircase
Make more path comparisons ignore case
This commit is contained in:
commit
a195f5af80
@ -275,7 +275,7 @@ namespace Wabbajack.Common
|
||||
|
||||
public bool InFolder(AbsolutePath folder)
|
||||
{
|
||||
return _path.StartsWith(folder._path + Path.DirectorySeparator);
|
||||
return _path.StartsWith(folder._path + Path.DirectorySeparator, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public async Task<byte[]> ReadAllBytesAsync()
|
||||
@ -386,7 +386,7 @@ namespace Wabbajack.Common
|
||||
|
||||
public int CompareTo(AbsolutePath other)
|
||||
{
|
||||
return string.Compare(_path, other._path, StringComparison.Ordinal);
|
||||
return string.Compare(_path, other._path, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public string ReadAllText()
|
||||
|
@ -136,12 +136,12 @@ namespace Wabbajack.Common
|
||||
|
||||
public bool StartsWith(string s)
|
||||
{
|
||||
return _path.StartsWith(s);
|
||||
return _path.StartsWith(s, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public bool StartsWith(RelativePath s)
|
||||
{
|
||||
return _path.StartsWith(s._path);
|
||||
return _path.StartsWith(s._path, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public RelativePath Combine(params RelativePath[] paths )
|
||||
@ -156,7 +156,7 @@ namespace Wabbajack.Common
|
||||
|
||||
public int CompareTo(RelativePath other)
|
||||
{
|
||||
return string.Compare(_path, other._path, StringComparison.Ordinal);
|
||||
return string.Compare(_path, other._path, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -866,7 +866,7 @@ namespace Wabbajack.Common
|
||||
|
||||
public static bool IsInPath(this string path, string parent)
|
||||
{
|
||||
return path.ToLower().TrimEnd('\\').StartsWith(parent.ToLower().TrimEnd('\\') + "\\");
|
||||
return path.ToLower().TrimEnd('\\').StartsWith(parent.ToLower().TrimEnd('\\') + "\\", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public static async Task CopyToLimitAsync(this Stream frm, Stream tw, long limit)
|
||||
|
@ -15,7 +15,7 @@ namespace Wabbajack.Lib.CompilationSteps
|
||||
|
||||
public override async ValueTask<Directive?> Run(RawSourceFile source)
|
||||
{
|
||||
if (!((string)source.Path).StartsWith(_startDir)) return null;
|
||||
if (!((string)source.Path).StartsWith(_startDir, System.StringComparison.OrdinalIgnoreCase)) return null;
|
||||
var i = source.EvolveTo<IgnoredDirectly>();
|
||||
i.Reason = "Default game file";
|
||||
return i;
|
||||
|
Loading…
Reference in New Issue
Block a user