]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/ftp.cpp
Quote file names with spaces in wxFileType::ExpandCommand().
[wxWidgets.git] / src / common / ftp.cpp
index b1761ba38720d77ae9135a885f6f10ffa67d0666..218fa457842eb05cafea224ffb0c3bac89504772 100644 (file)
@@ -155,11 +155,15 @@ bool wxFTP::Connect(const wxSockAddress& addr, bool WXUNUSED(wait))
     return true;
 }
 
-bool wxFTP::Connect(const wxString& host)
+bool wxFTP::Connect(const wxString& host, unsigned short port)
 {
     wxIPV4address addr;
     addr.Hostname(host);
-    addr.Service(wxT("ftp"));
+
+    if ( port )
+        addr.Service(port);
+    else if (!addr.Service(wxT("ftp")))
+        addr.Service(21);
 
     return Connect(addr);
 }