Skip to content

Commit 825c61b

Browse files
authored
Merge branch 'master' into master
2 parents ab57c85 + f13f49b commit 825c61b

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/SharpCompress/Common/SevenZip/ArchiveReader.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,11 @@ out digests
996996
numFiles,
997997
delegate(int i, uint? attr)
998998
{
999+
// Keep the original attribute value because it could potentially get
1000+
// modified in the logic that follows. Some callers of the library may
1001+
// find the original value useful.
1002+
db._files[i].ExtendedAttrib = attr;
1003+
9991004
// Some third party implementations established an unofficial extension
10001005
// of the 7z archive format by placing posix file attributes in the high
10011006
// bits of the windows file attributes. This makes use of the fact that
@@ -1458,7 +1463,7 @@ private void OpenFile()
14581463
#if DEBUG
14591464
Log.WriteLine(_db._files[index].Name);
14601465
#endif
1461-
if (_db._files[index].CrcDefined)
1466+
if (_db._files[index].Crc.HasValue)
14621467
{
14631468
_stream = new CrcCheckStream(_db._files[index].Crc.Value);
14641469
}

src/SharpCompress/Common/SevenZip/CFileItem.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,13 @@ internal class CFileItem
88
{
99
public long Size { get; internal set; }
1010
public uint? Attrib { get; internal set; }
11+
public uint? ExtendedAttrib { get; internal set; }
1112
public uint? Crc { get; internal set; }
1213
public string Name { get; internal set; }
1314

1415
public bool HasStream { get; internal set; }
1516
public bool IsDir { get; internal set; }
1617

17-
public bool CrcDefined => Crc != null;
18-
19-
public bool AttribDefined => Attrib != null;
20-
21-
public void SetAttrib(uint attrib) => Attrib = attrib;
22-
2318
public DateTime? CTime { get; internal set; }
2419
public DateTime? ATime { get; internal set; }
2520
public DateTime? MTime { get; internal set; }

src/SharpCompress/Common/SevenZip/SevenZipEntry.cs

+3
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@ public class SevenZipEntry : Entry
3838
public override int? Attrib =>
3939
FilePart.Header.Attrib.HasValue ? (int?)FilePart.Header.Attrib.Value : null;
4040

41+
public int? ExtendedAttrib =>
42+
FilePart.Header.ExtendedAttrib.HasValue ? (int?)FilePart.Header.ExtendedAttrib.Value : null;
43+
4144
internal override IEnumerable<FilePart> Parts => FilePart.AsEnumerable<FilePart>();
4245
}

0 commit comments

Comments
 (0)