Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_header_int: allow leading spaces #116

Merged
merged 4 commits into from
Jun 4, 2021
Merged

Commits on Jun 4, 2021

  1. read_header_int: allow leading spaces (fix #111)

    Some old versions of `tar` (e.g. Solaris) emitted integer fields with
    leadings *spaces* which is technically contrary to the standard, but
    seems harmless to support. This adds a fragment of this tarball:
    
        https://sparse.tamu.edu/MM/Oberwolfach/LF10.tar.gz
    
    This is a collection of example sparse matrix files. The fragment is a
    single header entry followed by one block of data and is a valid tarball
    by itself with the idiosyncratic field formatting of Solaris `tar`.
    StefanKarpinski committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    ed0c4d2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bef4dc9 View commit details
    Browse the repository at this point in the history
  3. read_standard_header: improve error checks & messages

    This is a fairly significant refactoring of the error checking aspect of
    header parsing with a few high-level improvements. The first major
    improvement is that this now extracts and checks the version string
    first, then the checksum and only if those are valid does it try
    extracting any other fields. This makes the error message a bit clearer:
    previously you would get a cryptic complaint about an invalid octal
    digit if you tried to parse something that wasn't a tar file, now at
    least you get an "invalid version string for tar file" error.
    
    This now also dumps the entire header data if there is any error parsing
    the header, which helps with diagnosis. In addition, the error checking
    and reporting for boundary conditions in fields which can be malformed
    (i.e. octal integers) is much improved.
    
    Last but not least, the test coverage of all of this is much increased.
    StefanKarpinski committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    cbcb00b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    45197a8 View commit details
    Browse the repository at this point in the history