浏览代码

Windows needs remove before rename

Czajkowski, Piotr 5 年之前
父节点
当前提交
4e181234f0
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      zip.c

+ 2 - 0
zip.c

@@ -67,6 +67,7 @@ int anonymize(const char *infile, char *outfile) {
 
 		const char *outfile = "tmpFile.docx";
 		processDOCX(infile, outfile);
+		remove(infile);
 		rename(outfile, infile);
 	} else {
 		strcat(binnFile, outfile);
@@ -84,6 +85,7 @@ int deanonymize(const char *infile, char *outfile) {
 	if (!outfile || strcmp(infile, outfile) == 0){
 		const char *outfile = "tmpFile.docx";
 		processDOCX(infile, outfile);
+		remove(infile);
 		rename(outfile, infile);
 	} else {
 		processDOCX(infile, outfile);