Merge pull request #7 from CaitSith2/master

Fix case sensitivity issues with long filenames.
This commit is contained in:
Alex Barney 2018-08-25 22:28:36 -06:00 committed by GitHub
commit 0bea29e59e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -134,7 +134,7 @@ namespace DiscUtils.Fat
if (!TryLoadCurrentCluster()) if (!TryLoadCurrentCluster())
{ {
if ((_position == _length || _position == DetectLength()) && !_atEOF) if ((_position == _length || _position == DetectLength()))
{ {
_atEOF = true; _atEOF = true;
return 0; return 0;

View file

@ -126,19 +126,19 @@ namespace DiscUtils.Fat
public bool Equals(FileName other) public bool Equals(FileName other)
{ {
if (other == null) if (other is null)
{ {
return false; return false;
} }
if (!string.IsNullOrEmpty(LongName) && !string.IsNullOrEmpty(other.LongName)) if (!string.IsNullOrEmpty(LongName) && !string.IsNullOrEmpty(other.LongName))
return LongName == other.LongName; return LongName.Equals(other.LongName, StringComparison.InvariantCultureIgnoreCase);
return CompareRawNames(this, other) == 0; return CompareRawNames(this, other) == 0;
} }
public static FileName FromPath(string path, Encoding encoding) public static FileName FromPath(string path, Encoding encoding)
{ {
return new FileName(Utilities.GetFileFromPath(path), encoding, false); return new FileName(Utilities.GetFileFromPath(path), encoding, true);
} }
public static bool operator ==(FileName a, FileName b) public static bool operator ==(FileName a, FileName b)