Fix ISO9660 with files of size 0.

This commit is contained in:
2020-04-18 20:49:46 +01:00
parent ac985bf646
commit c321a59b3a
2 changed files with 7 additions and 4 deletions

View File

@@ -412,7 +412,8 @@ namespace Aaru.Filesystems.ISO9660
entries[entry.Filename].XattrLength = entry.XattrLength;
}
entries[entry.Filename].Extents.Add(entry.Extents[0]);
if(entry.Extents?.Count > 0)
entries[entry.Filename].Extents.Add(entry.Extents[0]);
}
else
entries[entry.Filename] = entry;

View File

@@ -175,12 +175,14 @@ namespace Aaru.Filesystems.ISO9660
stat = new FileEntryInfo
{
Attributes = new FileAttributes(), Blocks = (long)(entry.Size / 2048), // TODO: XA
BlockSize = 2048, Length = (long)entry.Size,
Inode = entry.Extents?[0].extent ?? 0, Links = 1,
Attributes = new FileAttributes(), Blocks = (long)(entry.Size / 2048), // TODO: XA
BlockSize = 2048, Length = (long)entry.Size, Links = 1,
LastWriteTimeUtc = entry.Timestamp
};
if(entry.Extents?.Count > 0)
stat.Inode = entry.Extents[0].extent;
if(entry.Size % 2048 > 0)
stat.Blocks++;