From 98122963c08f6bec1195719878e47d723a48c2f3 Mon Sep 17 00:00:00 2001 From: liduo Date: Fri, 29 Aug 2025 17:18:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=89=A9=E5=B1=95=E5=90=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liduo --- src/compression_parser.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/compression_parser.cpp b/src/compression_parser.cpp index 26504a4..4b11b01 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); -- Gitee