diff options
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 ) |