소스 검색

Z991239-2196 #comment fix: linux下兼容zip包中\\的路径

Signed-Off-By: commit-hook
刘文涛80174520 4 년 전
부모
커밋
f6bf3dc5e7
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      Module/mod_UpgradeRun/XUnZipZilb.cpp

+ 6 - 1
Module/mod_UpgradeRun/XUnZipZilb.cpp

@@ -250,7 +250,12 @@ int unZipCurrentFile(zipFile zf, string destDirPath)
 
 	//替换newFileName字符串中的'/'到对应平台路径
 #ifdef RVC_OS_WIN
-	if (!replaceInPlace(newFileName, "/", "\\")) {
+	if (!replacePlace(newFileName, "/", "\\")) {
+		Dbg("replaceInPlace zip fileName fail:zipFileName(%s)", newFileName.c_str());
+		return -1;
+	}
+#else
+	if (!replacePlace(newFileName, "\\", "/")) {
 		Dbg("replaceInPlace zip fileName fail:zipFileName(%s)", newFileName.c_str());
 		return -1;
 	}