diff --git a/src/compression_parser.cpp b/src/compression_parser.cpp index 26504a4509e0b299cfad4e7ec692bd31c8a17750..4b11b01a456c2beea33d3cdd03ffea1db84947aa 100644 --- a/src/compression_parser.cpp +++ b/src/compression_parser.cpp @@ -560,14 +560,10 @@ bool CompressionParser::CheckAndTranscode(const string &src, string &dst, string bool CompressionParser::CopyForTrans(const string &src, const string &originDst, const string &dst) { - string srcSuffix; - string dstSuffix; - auto srcIndex = src.find_last_of("."); - auto dstIndex = dst.find_last_of("."); - if (srcIndex != string::npos && dstIndex != string::npos) { - srcSuffix = src.substr(srcIndex + 1); - dstSuffix = dst.substr(dstIndex + 1); - } + FileEntry srcFile(src); + FileEntry dstFile(dst); + string srcSuffix = srcFile.GetFilePath().GetExtension(); + string dstSuffix = dstFile.GetFilePath().GetExtension(); auto ret = false; if (srcSuffix == dstSuffix) { ret = ResourceUtil::CopyFileInner(src, dst);