adamhathcock/sharpcompress — pull request #28 by Strachu (2014-12-16 10:54:40+00:00)
Title: Fixed bugs related to handling of .tar archives with long names

I have fixed 2 bugs related to reading of .tar archives.

1. The "magic" for ustar archive is "ustar" + null character instead of "ustar " (note the following space). Before the fix the code was not recognizing the format correctly, making issues when the archive had very long name.
2. When the archive (now not in "ustar" format) had very long names, the entries which were after the one with very long name were not loaded.
It was caused by 2 issues:
1. method entry.WriteTo() called during loading internally caused the marking of the archive as fully loaded without loading entries after the one currently read.
2. because entries use shared stream for reading, reading the name of entry is changing the current position of the stream without restoring previous position.

I have attached test cases for these bugs, they fail without my fixes.