Fixed logic for stdout output

This commit is contained in:
senhuang42 2020-10-07 13:43:27 -04:00
parent 1ebe360d0f
commit dd3dac9ce0

View File

@ -2124,6 +2124,7 @@ FIO_decompressZstdFrame(FIO_ctx_t* const fCtx, dRess_t* ress, FILE* finput,
/* Write block */ /* Write block */
storedSkips = FIO_fwriteSparse(ress->dstFile, ress->dstBuffer, outBuff.pos, prefs, storedSkips); storedSkips = FIO_fwriteSparse(ress->dstFile, ress->dstBuffer, outBuff.pos, prefs, storedSkips);
frameSize += outBuff.pos; frameSize += outBuff.pos;
if (!fCtx->hasStdoutOutput) {
if (fCtx->nbFilesTotal > 1) { if (fCtx->nbFilesTotal > 1) {
size_t srcFileNameSize = strlen(srcFileName); size_t srcFileNameSize = strlen(srcFileName);
if (srcFileNameSize > 18) { if (srcFileNameSize > 18) {
@ -2138,6 +2139,7 @@ FIO_decompressZstdFrame(FIO_ctx_t* const fCtx, dRess_t* ress, FILE* finput,
DISPLAYUPDATE(2, "\r%-20.20s : %u MB... ", DISPLAYUPDATE(2, "\r%-20.20s : %u MB... ",
srcFileName, (unsigned)((alreadyDecoded+frameSize)>>20) ); srcFileName, (unsigned)((alreadyDecoded+frameSize)>>20) );
} }
}
if (inBuff.pos > 0) { if (inBuff.pos > 0) {
memmove(ress->srcBuffer, (char*)ress->srcBuffer + inBuff.pos, inBuff.size - inBuff.pos); memmove(ress->srcBuffer, (char*)ress->srcBuffer + inBuff.pos, inBuff.size - inBuff.pos);