[sword-svn] r3150 - trunk/utilities

scribe at crosswire.org scribe at crosswire.org
Sun Apr 13 16:12:30 MST 2014


Author: scribe
Date: 2014-04-13 16:12:30 -0700 (Sun, 13 Apr 2014)
New Revision: 3150

Modified:
   trunk/utilities/imp2ld.cpp
Log:
fixed == bug
added check to prevent infinite loop if file not found

Modified: trunk/utilities/imp2ld.cpp
===================================================================
--- trunk/utilities/imp2ld.cpp	2014-04-03 07:57:16 UTC (rev 3149)
+++ trunk/utilities/imp2ld.cpp	2014-04-13 23:12:30 UTC (rev 3150)
@@ -143,6 +143,10 @@
 	}
 
 	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);
+	}
 
 
 	SWModule *mod = 0;
@@ -165,7 +169,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




More information about the sword-cvs mailing list