[sword-svn] r3888 - in trunk: include src/mgr

scribe at crosswire.org scribe at crosswire.org
Mon Apr 17 16:35:07 EDT 2023


Author: scribe
Date: 2023-04-17 16:35:06 -0400 (Mon, 17 Apr 2023)
New Revision: 3888

Modified:
   trunk/include/filemgr.h
   trunk/include/swversion.h
   trunk/src/mgr/filemgr.cpp
Log:
added option to skip strip during FileMgr::getLine


Modified: trunk/include/filemgr.h
===================================================================
--- trunk/include/filemgr.h	2022-11-03 23:32:24 UTC (rev 3887)
+++ trunk/include/filemgr.h	2023-04-17 20:35:06 UTC (rev 3888)
@@ -193,7 +193,7 @@
 	static int copyDir(const char *srcDir, const char *destDir);
 	static int removeDir(const char *targetDir);
 	static int removeFile(const char *fName);
-	static char getLine(FileDesc *fDesc, SWBuf &line);
+	static char getLine(FileDesc *fDesc, SWBuf &line, bool strip = true);
 
 	/**
 	 * Determines where SWORD looks for the user's home folder.  This is

Modified: trunk/include/swversion.h
===================================================================
--- trunk/include/swversion.h	2022-11-03 23:32:24 UTC (rev 3887)
+++ trunk/include/swversion.h	2023-04-17 20:35:06 UTC (rev 3888)
@@ -24,12 +24,12 @@
 #ifndef SWVERSION_H
 #define SWVERSION_H
 
-#define SWORD_VERSION_NUM 1090003874
-#define SWORD_VERSION_STR "1.9.0.3874M"
+#define SWORD_VERSION_NUM 1090003887
+#define SWORD_VERSION_STR "1.9.0.3887"
 #define SWORD_VERSION_MAJOR 1
 #define SWORD_VERSION_MINOR 9
 #define SWORD_VERSION_MICRO 0
-#define SWORD_VERSION_NANO 3874
+#define SWORD_VERSION_NANO 3887
 
 #include <defs.h>
 SWORD_NAMESPACE_START

Modified: trunk/src/mgr/filemgr.cpp
===================================================================
--- trunk/src/mgr/filemgr.cpp	2022-11-03 23:32:24 UTC (rev 3887)
+++ trunk/src/mgr/filemgr.cpp	2023-04-17 20:35:06 UTC (rev 3888)
@@ -524,7 +524,7 @@
 }
 
 
-char FileMgr::getLine(FileDesc *fDesc, SWBuf &line) {
+char FileMgr::getLine(FileDesc *fDesc, SWBuf &line, bool strip) {
 	int len = 0;
 	bool more = true;
 	char chunk[255];
@@ -548,8 +548,9 @@
 		// clean up any preceding white space if we're at the beginning of line
 		if (!line.length()) {
 			for (;start < len; start++) {
-				if ((chunk[start] != 13) && (chunk[start] != ' ') && (chunk[start] != '\t'))
+				if (chunk[start] != 10 && chunk[start] != 13 && (!strip || (chunk[start] != ' ' && chunk[start] != '\t'))) {
 					break;
+				}
 			}
 		}
 
@@ -568,7 +569,7 @@
 		// clean up any trailing junk on line if we're at the end
 		if (!more) {
 			for (; end > start; end--) {
-				if ((chunk[end] != 10) && (chunk[end] != 13) && (chunk[end] != ' ') && (chunk[end] != '\t')) {
+				if (chunk[end] != 10 && chunk[end] != 13 && (!strip || (chunk[end] != ' ' && chunk[end] != '\t'))) {
 					if (chunk[end] == '\\') {
 						more = true;
 						end--;



More information about the sword-cvs mailing list