DiscUtils: Workaround a bug by always assuming the long name is used

This commit is contained in:
Alex Barney 2019-01-16 11:20:20 -06:00
parent c3026f04b6
commit fe1400476a
2 changed files with 6 additions and 2 deletions

View file

@ -63,6 +63,11 @@ namespace DiscUtils.Fat
_raw = new byte[11]; _raw = new byte[11];
byte[] bytes = encoding.GetBytes(name.ToUpperInvariant()); byte[] bytes = encoding.GetBytes(name.ToUpperInvariant());
if (useLongName)
{
LongName = name;
}
int nameIdx = 0; int nameIdx = 0;
int rawIdx = 0; int rawIdx = 0;
while (nameIdx < bytes.Length && bytes[nameIdx] != '.' && rawIdx < _raw.Length) while (nameIdx < bytes.Length && bytes[nameIdx] != '.' && rawIdx < _raw.Length)
@ -80,7 +85,6 @@ namespace DiscUtils.Fat
{ {
if(!useLongName) if(!useLongName)
throw new ArgumentException("File name too long '" + name + "'", nameof(name)); throw new ArgumentException("File name too long '" + name + "'", nameof(name));
LongName = name;
} }
if (rawIdx == 0) if (rawIdx == 0)
{ {

View file

@ -104,7 +104,7 @@ namespace LibHac.Nand
internal static string ToDiscUtilsPath(string path) internal static string ToDiscUtilsPath(string path)
{ {
return path.Replace("/", @"\\"); return path.Replace("/", @"\");
} }
} }
} }