diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2017-05-07 15:53:12 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2017-05-07 15:53:12 +0000 |
commit | 217f007824bd69712dada24a431c0f703d515fa3 (patch) | |
tree | f9e719e5800eda365dae0baf81f11a20467ac07f /alone_to_lz.cc | |
parent | Releasing debian version 1.18-5. (diff) | |
download | lziprecover-217f007824bd69712dada24a431c0f703d515fa3.tar.xz lziprecover-217f007824bd69712dada24a431c0f703d515fa3.zip |
Merging upstream version 1.19.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'alone_to_lz.cc')
-rw-r--r-- | alone_to_lz.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/alone_to_lz.cc b/alone_to_lz.cc index 22e3f29..e87a18a 100644 --- a/alone_to_lz.cc +++ b/alone_to_lz.cc @@ -1,5 +1,5 @@ /* Lziprecover - Data recovery tool for the lzip format - Copyright (C) 2009-2016 Antonio Diaz Diaz. + Copyright (C) 2009-2017 Antonio Diaz Diaz. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -91,7 +91,13 @@ int alone_to_lz( const int infd, const Pretty_print & pp ) { pp( "file is too short" ); std::free( buffer ); return 2; } if( buffer[0] != 93 ) // (45 * 2) + (9 * 0) + 3 { - pp( "file has non-default LZMA properties" ); + File_header & header = *(File_header *)buffer; + const unsigned dictionary_size = header.dictionary_size(); + if( header.verify_magic() && header.verify_version() && + isvalid_ds( dictionary_size ) ) + pp( "file is already in lzip format" ); + else + pp( "file has non-default LZMA properties" ); std::free( buffer ); return 2; } for( int i = 5; i < 13; ++i ) if( buffer[i] != 0xFF ) |