Refactor AppleDOS and solves bug preventing VTOC from being retrieved as "$Vtoc".

This commit is contained in:
2017-12-22 07:05:08 +00:00
parent 0ad9da7b3a
commit 56986338be
5 changed files with 50 additions and 61 deletions

View File

@@ -95,8 +95,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
if(string.Compare(xattr, "com.apple.dos.type", StringComparison.InvariantCulture) == 0)
{
byte type;
if(!fileTypeCache.TryGetValue(filename, out type)) return Errno.InvalidArgument;
if(!fileTypeCache.TryGetValue(filename, out byte type)) return Errno.InvalidArgument;
buf = new byte[1];
buf[0] = type;
@@ -106,8 +105,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
if(string.Compare(xattr, "com.apple.dos.tracksectorlist", StringComparison.InvariantCulture) != 0 || !debug)
return Errno.NoSuchExtendedAttribute;
byte[] ts;
if(!extentCache.TryGetValue(filename, out ts)) return Errno.InvalidArgument;
if(!extentCache.TryGetValue(filename, out byte[] ts)) return Errno.InvalidArgument;
buf = new byte[ts.Length];
Array.Copy(ts, 0, buf, 0, buf.Length);