commit
382ab21ea3
|
@ -433,6 +433,10 @@ static int FIO_compressFilename_extRess(cRess_t ress,
|
|||
|
||||
result = FIO_compressFilename_internal(ress, dstFileName, srcFileName, cLevel);
|
||||
|
||||
if (result != 0) {
|
||||
remove(dstFileName);
|
||||
}
|
||||
|
||||
fclose(ress.srcFile); /* no pb to expect : only reading */
|
||||
if (fclose(ress.dstFile)) EXM_THROW(28, "Write error : cannot properly close %s", dstFileName);
|
||||
return result;
|
||||
|
@ -638,13 +642,17 @@ static int FIO_decompressSrcFile(dRess_t ress, const char* srcFileName)
|
|||
static int FIO_decompressFile_extRess(dRess_t ress,
|
||||
const char* dstFileName, const char* srcFileName)
|
||||
{
|
||||
int result;
|
||||
ress.dstFile = FIO_openDstFile(dstFileName);
|
||||
if (ress.dstFile==0) return 1;
|
||||
|
||||
FIO_decompressSrcFile(ress, srcFileName);
|
||||
result = FIO_decompressSrcFile(ress, srcFileName);
|
||||
if (result != 0) {
|
||||
remove(dstFileName);
|
||||
}
|
||||
|
||||
if (fclose(ress.dstFile)) EXM_THROW(38, "Write error : cannot properly close %s", dstFileName);
|
||||
return 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -36,7 +36,10 @@ $ZSTD --decompress tmpCompressed --stdout > tmpResult
|
|||
$ZSTD -q tmp && die "overwrite check failed!"
|
||||
$ZSTD -q -f tmp
|
||||
$ZSTD -q --force tmp
|
||||
|
||||
$ZSTD -df tmp && die "should have refused : wrong extension"
|
||||
cp tmp tmp2.zst
|
||||
$ZSTD -df tmp2.zst && die "should have failed : wrong format"
|
||||
rm tmp2.zst
|
||||
|
||||
echo "\n**** frame concatenation **** "
|
||||
|
||||
|
|
Loading…
Reference in New Issue