Ver código fonte

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

Signed-Off-By: commit-hook
刘文涛80174520 4 anos atrás
pai
commit
f6bf3dc5e7
1 arquivos alterados com 6 adições e 1 exclusões
  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;
 	}