summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-08-26 18:16:43 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-08-26 18:16:43 +0000
commit404e500ea39d5bd24b46cb214ef731f20c515867 (patch)
tree6f8325d4a6cab6d67f8596a9289ba8b4859538b1
parent6a1a045e620dba38a7a64070af59d1a91b104921 (diff)
fix for bug with empty url
git-svn-id: http://svn.miranda-ng.org/main/trunk@15037 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/FTPFileYM/src/dialog.cpp16
-rw-r--r--plugins/FTPFileYM/src/job_upload.cpp2
-rw-r--r--plugins/FTPFileYM/src/serverlist.cpp6
3 files changed, 12 insertions, 12 deletions
diff --git a/plugins/FTPFileYM/src/dialog.cpp b/plugins/FTPFileYM/src/dialog.cpp
index b6004ad18d..6db6412c4a 100644
--- a/plugins/FTPFileYM/src/dialog.cpp
+++ b/plugins/FTPFileYM/src/dialog.cpp
@@ -165,6 +165,8 @@ LRESULT CALLBACK UploadDialog::TabControlProc(HWND hwnd, UINT msg, WPARAM wParam
INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
+ UploadJob *job;
+
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
@@ -247,17 +249,13 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
return TRUE;
case IDC_BTN_CLIPBOARD:
- {
- UploadJob *job = (UploadJob *)uDlg->m_tabs[uDlg->m_activeTab]->m_job;
- Utils::copyToClipboard(job->m_szFileLink);
- }
+ job = (UploadJob*)uDlg->m_tabs[uDlg->m_activeTab]->m_job;
+ Utils::copyToClipboard(job->m_szFileLink);
return TRUE;
case IDC_BTN_DOWNLOAD:
- {
- UploadJob *job = (UploadJob *)uDlg->m_tabs[uDlg->m_activeTab]->m_job;
- ShellExecuteA(NULL, "open", job->m_szFileLink, NULL, NULL, SW_SHOWNORMAL);
- }
+ job = (UploadJob*)uDlg->m_tabs[uDlg->m_activeTab]->m_job;
+ ShellExecuteA(NULL, "open", job->m_szFileLink, NULL, NULL, SW_SHOWNORMAL);
return TRUE;
case IDC_BTN_FILEMANAGER:
@@ -351,8 +349,8 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
return TRUE;
}
}
- break;
}
+ break;
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp
index 1ec70984ec..c0d4cebc12 100644
--- a/plugins/FTPFileYM/src/job_upload.cpp
+++ b/plugins/FTPFileYM/src/job_upload.cpp
@@ -280,7 +280,7 @@ void UploadJob::upload()
_tstat(m_tszFilePath, &fileInfo);
m_uiFileSize = (UINT64)fileInfo.st_size;
- CURL *hCurl = (getUrlString(), headerList);
+ CURL *hCurl = curlInit(getUrlString(), headerList);
if (!hCurl) {
Utils::msgBox(TranslateT("Error occurred when initializing libcurl.\nAborting file upload..."), MB_OK | MB_ICONERROR);
return;
diff --git a/plugins/FTPFileYM/src/serverlist.cpp b/plugins/FTPFileYM/src/serverlist.cpp
index 50814f92cf..878bbd87a6 100644
--- a/plugins/FTPFileYM/src/serverlist.cpp
+++ b/plugins/FTPFileYM/src/serverlist.cpp
@@ -72,13 +72,15 @@ ServerList::FTP::FTP(int index)
DB::getAStringF(0, MODULE, "Url%d", index, m_szUrl);
DB::getAStringF(0, MODULE, "Dir%d", index, m_szDir);
DB::getAStringF(0, MODULE, "Chmod%d", index, m_szChmod);
+ if (m_szUrl[0] == 0)
+ strcpy(m_szUrl, "/");
m_ftpProto = (FTP::EProtoType)DB::getWordF(0, MODULE, "FtpProto%d", index, FTP::FT_STANDARD);
m_iPort = DB::getWordF(0, MODULE, "Port%d", index, 21);
m_bPassive = DB::getByteF(0, MODULE, "Passive%d", index, 0) ? true : false;
m_bEnabled = DB::getByteF(0, MODULE, "Enabled%d", index, 0) ? true : false;
}
-ServerList::FTP *ServerList::getSelected() const
+ServerList::FTP* ServerList::getSelected() const
{
return ftpList[opt.selected];
}
@@ -88,7 +90,7 @@ bool ServerList::FTP::isValid() const
return (m_bEnabled && m_szServer[0] && m_szUser[0] && m_szPass[0] && m_szUrl[0]) ? true : false;
}
-char *ServerList::FTP::getProtoString() const
+char* ServerList::FTP::getProtoString() const
{
switch (m_ftpProto) {
case FT_STANDARD: