From 7088f60425f8288bfc8ac8170d238264691b2e44 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sat, 1 Jan 2011 02:01:10 +0000 Subject: [PATCH] - more ftp tileset bugfixes --- .../sources/platform/posix/miniftpclient.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/shared_lib/sources/platform/posix/miniftpclient.cpp b/source/shared_lib/sources/platform/posix/miniftpclient.cpp index 6b8b1c52b..77b571a7d 100644 --- a/source/shared_lib/sources/platform/posix/miniftpclient.cpp +++ b/source/shared_lib/sources/platform/posix/miniftpclient.cpp @@ -251,6 +251,9 @@ FTP_Client_ResultType FTPClientThread::getTilesetFromServer(string tileSetName, destFile += "/"; } destFile += tileSetName; + if(EndsWith(destFile,"/") == false && EndsWith(destFile,"\\") == false) { + destFile += "/"; + } if(tileSetNameSubfolder != "") { destFile += tileSetNameSubfolder; @@ -275,7 +278,12 @@ FTP_Client_ResultType FTPClientThread::getTilesetFromServer(string tileSetName, ftpfile.stream = NULL; char szBuf[1024]=""; - sprintf(szBuf,"ftp://%s:%s@%s:%d/%s*",ftpUser.c_str(),ftpUserPassword.c_str(),serverUrl.c_str(),portNumber,tileSetName.c_str()); + if(tileSetNameSubfolder == "") { + sprintf(szBuf,"ftp://%s:%s@%s:%d/%s/*",ftpUser.c_str(),ftpUserPassword.c_str(),serverUrl.c_str(),portNumber,tileSetName.c_str()); + } + else { + sprintf(szBuf,"ftp://%s:%s@%s:%d/%s/%s/*",ftpUser.c_str(),ftpUserPassword.c_str(),serverUrl.c_str(),portNumber,tileSetName.c_str(),tileSetNameSubfolder.c_str()); + } curl_easy_setopt(curl, CURLOPT_URL,szBuf);