Clean up check for emitting a single raw block

This commit is contained in:
emmanuel-marty 2019-05-12 23:21:50 +02:00
parent c96594680a
commit 0f4ffa7166

View File

@ -204,6 +204,7 @@ static int do_compress(const char *pszInFilename, const char *pszOutFilename, co
}
int nPreviousBlockSize = 0;
int nNumBlocks = 0;
if (nDictionaryDataSize)
nPreviousBlockSize = nDictionaryDataSize;
@ -217,7 +218,7 @@ static int do_compress(const char *pszInFilename, const char *pszOutFilename, co
nInDataSize = (int)fread(pInData + BLOCK_SIZE, 1, BLOCK_SIZE, f_in);
if (nInDataSize > 0) {
if (nPreviousBlockSize && (nOptions & OPT_RAW) != 0 && !nDictionaryDataSize) {
if ((nOptions & OPT_RAW) != 0 && nNumBlocks) {
fprintf(stderr, "error: raw blocks can only be used with files <= 64 Kb\n");
bError = true;
break;
@ -281,6 +282,7 @@ static int do_compress(const char *pszInFilename, const char *pszOutFilename, co
}
nPreviousBlockSize = nInDataSize;
nNumBlocks++;
}
if (!bError && !feof(f_in) && nOriginalSize >= 1024 * 1024) {