mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
DiscUtils: Workaround a bug by always assuming the long name is used
This commit is contained in:
parent
c3026f04b6
commit
fe1400476a
2 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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("/", @"\");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue