[sword-cvs] sword/src/mgr swmgr.cpp,1.100,1.101

sword@www.crosswire.org sword@www.crosswire.org
Tue, 30 Mar 2004 12:35:17 -0700


Update of /cvs/core/sword/src/mgr
In directory www:/tmp/cvs-serv15853/src/mgr

Modified Files:
	swmgr.cpp 
Log Message:
Fix to only parse mods.d/*.conf files (joachim)

Index: swmgr.cpp
===================================================================
RCS file: /cvs/core/sword/src/mgr/swmgr.cpp,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- swmgr.cpp	6 Feb 2004 21:01:01 -0000	1.100
+++ swmgr.cpp	30 Mar 2004 19:35:15 -0000	1.101
@@ -588,6 +588,11 @@
 	if ((dir = opendir(ipath))) {
 		rewinddir(dir);
 		while ((ent = readdir(dir))) {
+			//chck whether it ends with .conf, if it doesn't skip it!
+			if (strncmp(".conf", (ent->d_name + strlen(ent->d_name) - 5), 5 )) {
+				continue;
+			}
+			
 			if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
 				newmodfile = ipath;
 				if ((ipath[strlen(ipath)-1] != '\\') && (ipath[strlen(ipath)-1] != '/'))
@@ -601,6 +606,7 @@
 			}
 		}
 		closedir(dir);
+		
 		if (!config) {	// if no .conf file exist yet, create a default
 			newmodfile = ipath;
 			if ((ipath[strlen(ipath)-1] != '\\') && (ipath[strlen(ipath)-1] != '/'))