[sword-svn] r1816 - trunk/src/mgr

jansorg at crosswire.org jansorg at crosswire.org
Sun May 22 04:59:57 MST 2005


Author: jansorg
Date: 2005-05-22 04:59:56 -0700 (Sun, 22 May 2005)
New Revision: 1816

Modified:
   trunk/src/mgr/ftptrans.cpp
Log:
fixed remote module download; two slashes at the end break the getDirList method

Modified: trunk/src/mgr/ftptrans.cpp
===================================================================
--- trunk/src/mgr/ftptrans.cpp	2005-05-22 03:59:57 UTC (rev 1815)
+++ trunk/src/mgr/ftptrans.cpp	2005-05-22 11:59:56 UTC (rev 1816)
@@ -89,7 +89,11 @@
 	int i;
 	int retVal = 0;
 	
-	SWBuf url = (SWBuf)urlPrefix + (SWBuf)dir + "/"; //dont forget the final slash
+	SWBuf url = SWBuf(urlPrefix) + SWBuf(dir);
+	if (url[url.length()-1] != '/') {
+		url.append('/'); //don't forget the final slash if it's not yet at the end
+	}
+	
 	SWLog::getSystemLog()->logWarning("FTPCopy: getting dir %s\n", url.c_str());
 	vector<struct ftpparse> dirList = getDirList(url.c_str());
 



More information about the sword-cvs mailing list