From f66fabc4c5e5085c110f7cdae627d7ca042386cf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 May 2017 17:52:21 +0200 Subject: Adding upstream version 1.19. Signed-off-by: Daniel Baumann --- alone_to_lz.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'alone_to_lz.cc') 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 ) -- cgit v1.2.3