[sword-svn] r3212 - trunk/utilities

scribe at crosswire.org scribe at crosswire.org
Wed Apr 30 22:12:28 MST 2014


Author: scribe
Date: 2014-04-30 22:12:28 -0700 (Wed, 30 Apr 2014)
New Revision: 3212

Modified:
   trunk/utilities/imp2ld.cpp
Log:
fix lds

Modified: trunk/utilities/imp2ld.cpp
===================================================================
--- trunk/utilities/imp2ld.cpp	2014-05-01 05:12:13 UTC (rev 3211)
+++ trunk/utilities/imp2ld.cpp	2014-05-01 05:12:28 UTC (rev 3212)
@@ -149,15 +149,7 @@
 	}
 
 	std::ifstream infile(inFileName);
-	if (!infile.is_open()) {
-		fprintf(stderr, "\nERROR: %s: could not open file for reading: %s\n\n", *argv, inFileName);
-		exit(-2);
-	}
 
-	if(!infile.is_open()) {
-		std::cout << "Unable to open file " << inFileName << std::endl;
-		return -1;
-	}
 
 	SWModule *mod = 0;
 	SWKey *key, *linkKey;
@@ -179,7 +171,7 @@
 		usage(*argv, "ERROR: SWORD library not compiled with bzip2 compression support.\n\tBe sure libbz2 is available when compiling SWORD library");
 #endif
 	}
-	else if (compType == "XZ") {
+	else if (compType = "XZ") {
 #ifndef EXCLUDEXZ
 		compressor = new XzCompress();
 #else
@@ -235,7 +227,6 @@
 					SWLD::strongsPad(buf);
 					if(strcmp(buf, *key))
 						std::cout << "Warning: entry " << *key << " is a number but not padded correctly. ";
-					delete buf;
 				}
 
 				mod->setEntry(entbuffer.c_str(), entbuffer.size());
@@ -266,15 +257,13 @@
 		std::cout << keybuffer << std::endl;
 		*key = keybuffer.c_str();
 
-		if(paddingCheck) {
-			char *buf = new char [ strlen(*key) + 6 ];
-			strcpy(buf, *key);
-			SWLD::strongsPad(buf);
-			if(strcmp(buf, *key))
-				std::cout << "Warning: entry " << *key << " is a number but not padded correctly. ";
-			delete buf;
-		}
-		
+				if(paddingCheck) {
+					char *buf = new char [ strlen(*key) + 6 ];
+					strcpy(buf, *key);
+					SWLD::strongsPad(buf);
+					if(strcmp(buf, *key))
+						std::cout << "Warning: entry " << *key << " is a number but not padded correctly. ";
+				}
 		mod->setEntry(entbuffer.c_str(), entbuffer.size());
 		for (i = 0; i < links; i++) {
 			std::cout << "Linking: " << linkbuffer[i] << std::endl;
@@ -286,6 +275,7 @@
 	infile.close();
 
 	delete linkKey;
+	delete key;
 	delete mod;
 
 	return 0;




More information about the sword-cvs mailing list