git » fp-git.git » commit bb4d8ae

reseted the resource count number when folder changes

author ecalot
2005-12-21 19:56:08 UTC
committer ecalot
2005-12-21 19:56:08 UTC
parent ea01f65e62305f960b395df5e5d76bd7b35da3ec

reseted the resource count number when folder changes

PR/src/lib/xml/tree.c +3 -1
PR/src/lib/xml/unknown.c +3 -1

diff --git a/PR/src/lib/xml/tree.c b/PR/src/lib/xml/tree.c
index f040f1b..d503099 100644
--- a/PR/src/lib/xml/tree.c
+++ b/PR/src/lib/xml/tree.c
@@ -96,7 +96,7 @@ int unknownLogStart (const char* file,int optionflag, const char* backupExtensio
 	if (unknownFile.fd) return -1; /* File already open */
 
 	/* Use default filename if file is NULL */
-	if (!file) file="unknown.xml";
+	if (!file) file=RES_XML_UNKNOWN_XML;
 
 	/* Remember optionflag and backupExtension */
 	unknownFile.optionflag=optionflag;
@@ -143,10 +143,12 @@ int unknownLogAppend(const char* vFiledatWithPath,tResourceId id,const char* ext
 		unknown_folder(vFiledat,vFiledatWithPath,pal.value,translateInt2Ext(toLower(pal.index)));
 		unknownFile.currentDat=strallocandcopy(vFiledat);
 	} else if (!equalsIgnoreCase(unknownFile.currentDat,vFiledat)) {
+		int i;
 		unknown_folderclose(); 
 		unknown_folder(vFiledat,vFiledatWithPath,pal.value,translateInt2Ext(toLower(pal.index)));
 		freeAllocation(unknownFile.currentDat);
 		unknownFile.currentDat=strallocandcopy(vFiledat);
+		for (i=0;i<RES_TYPECOUNT;i++) unknownFile.typeCount[i]=0; /* re-initialize in 0 for next file processing */
 	}
 
 	unknown_item(id.value,translateInt2Ext(toLower(id.index)),filename,getExtDesc(type),flags,getExtDesc(type),count);
diff --git a/PR/src/lib/xml/unknown.c b/PR/src/lib/xml/unknown.c
index f040f1b..d503099 100644
--- a/PR/src/lib/xml/unknown.c
+++ b/PR/src/lib/xml/unknown.c
@@ -96,7 +96,7 @@ int unknownLogStart (const char* file,int optionflag, const char* backupExtensio
 	if (unknownFile.fd) return -1; /* File already open */
 
 	/* Use default filename if file is NULL */
-	if (!file) file="unknown.xml";
+	if (!file) file=RES_XML_UNKNOWN_XML;
 
 	/* Remember optionflag and backupExtension */
 	unknownFile.optionflag=optionflag;
@@ -143,10 +143,12 @@ int unknownLogAppend(const char* vFiledatWithPath,tResourceId id,const char* ext
 		unknown_folder(vFiledat,vFiledatWithPath,pal.value,translateInt2Ext(toLower(pal.index)));
 		unknownFile.currentDat=strallocandcopy(vFiledat);
 	} else if (!equalsIgnoreCase(unknownFile.currentDat,vFiledat)) {
+		int i;
 		unknown_folderclose(); 
 		unknown_folder(vFiledat,vFiledatWithPath,pal.value,translateInt2Ext(toLower(pal.index)));
 		freeAllocation(unknownFile.currentDat);
 		unknownFile.currentDat=strallocandcopy(vFiledat);
+		for (i=0;i<RES_TYPECOUNT;i++) unknownFile.typeCount[i]=0; /* re-initialize in 0 for next file processing */
 	}
 
 	unknown_item(id.value,translateInt2Ext(toLower(id.index)),filename,getExtDesc(type),flags,getExtDesc(type),count);