diff --git a/.gitignore b/.gitignore index 18165240..f8024e02 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,6 @@ _zstdbench/ # CMake projects/cmake/ + +# Test artefacts +tmp* diff --git a/programs/fileio.c b/programs/fileio.c index 3eb8d881..f805545b 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -330,7 +330,6 @@ static int FIO_compressFilename_internal(cRess_t ress, } } /* Main compression loop */ - readsize = 0; while (1) { /* Fill input Buffer */ size_t const inSize = fread(ress.srcBuffer, (size_t)1, ress.srcBufferSize, srcFile); @@ -338,8 +337,8 @@ static int FIO_compressFilename_internal(cRess_t ress, readsize += inSize; DISPLAYUPDATE(2, "\rRead : %u MB ", (U32)(readsize>>20)); - { /* Compress using buffered streaming */ - size_t usedInSize = inSize; + /* Compress using buffered streaming */ + { size_t usedInSize = inSize; size_t cSize = ress.dstBufferSize; { size_t const result = ZBUFF_compressContinue(ress.ctx, ress.dstBuffer, &cSize, ress.srcBuffer, &usedInSize); if (ZBUFF_isError(result)) EXM_THROW(23, "Compression error : %s ", ZBUFF_getErrorName(result)); } @@ -366,8 +365,10 @@ static int FIO_compressFilename_internal(cRess_t ress, } /* Status */ + { size_t const len = strlen(srcFileName); + if (len > 20) srcFileName += len-20; } DISPLAYLEVEL(2, "\r%79s\r", ""); - DISPLAYLEVEL(2,"%-20.20s :%6.2f%% (%6llu =>%6llu bytes, %s) \n", srcFileName, + DISPLAYLEVEL(2,"%-20.20s :%6.2f%% (%6llu => %6llu bytes, %s) \n", srcFileName, (double)compressedfilesize/readsize*100, (unsigned long long)readsize, (unsigned long long) compressedfilesize, dstFileName); diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 24fc33b7..6669f5a2 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -28,6 +28,14 @@ */ +/*-************************************ +* Tuning parameters +**************************************/ +#ifndef ZSTDCLI_DEFAULT_CLEVEL +# define ZSTDCLI_DEFAULT_CLEVEL 3 +#endif + + /*-************************************ * Includes **************************************/ @@ -207,7 +215,7 @@ int main(int argCount, const char** argv) nextArgumentIsMaxDict=0, nextArgumentIsDictID=0, nextArgumentIsFile=0; - unsigned cLevel = 1; + unsigned cLevel = ZSTDCLI_DEFAULT_CLEVEL; unsigned cLevelLast = 1; unsigned recursive = 0; const char** filenameTable = (const char**)malloc(argCount * sizeof(const char*)); /* argCount >= 1 */ @@ -331,7 +339,7 @@ int main(int argCount, const char** argv) /* test compressed file */ case 't': decode=1; outFileName=nulmark; argument++; break; - /* dictionary name */ + /* destination file name */ case 'o': nextArgumentIsOutFileName=1; argument++; break; /* recursive */