#1790 short tar's extensions tgz, txz, tlz4m .tzst should be decompressed with .tar suffix

This commit is contained in:
Sergey Ponomarev
2019-09-18 09:23:10 +03:00
parent bfb4d830b2
commit dafe796e39
+9
View File
@@ -2212,6 +2212,15 @@ FIO_determineDstName(const char* srcFileName)
assert(dstFileNameBuffer != NULL);
size_t dstFileNameEndPos = sfnSize - suffixSize;
memcpy(dstFileNameBuffer, srcFileName, dstFileNameEndPos);
/* The short tar extensions tzst, tgz, txz and tlz4 files should have "tar" extension on decompression
* To check that the file is one of them we can check that it starts with "t"
*/
if (suffixPtr[1] == 't') {
dstFileNameBuffer[dstFileNameEndPos++] = '.';
dstFileNameBuffer[dstFileNameEndPos++] = 't';
dstFileNameBuffer[dstFileNameEndPos++] = 'a';
dstFileNameBuffer[dstFileNameEndPos++] = 'r';
}
dstFileNameBuffer[dstFileNameEndPos] = '\0';
return dstFileNameBuffer;