X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f4ada568223b79c8a5769cc351c36a8e2ccd7841..9257d0b705e4d331dfea6481cf577dbb350cd597:/src/common/ftp.cpp diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp index 461dd93417..ee2ac234d5 100644 --- a/src/common/ftp.cpp +++ b/src/common/ftp.cpp @@ -12,7 +12,17 @@ #ifdef __GNUG__ #pragma implementation "ftp.h" #endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef __MWERKS__ #include +#endif #include #include "wx/string.h" #include "wx/utils.h" @@ -150,12 +160,12 @@ bool wxFTP::GetResult(char exp) { if ((m_lastError = GetLine(this, m_lastResult))) return FALSE; - if (m_lastResult[0UL] != exp) { + if (m_lastResult.GetChar(0) != exp) { m_lastError = wxPROTO_PROTERR; return FALSE; } - if (m_lastResult[3UL] == '-') { + if (m_lastResult.GetChar(3) == '-') { wxString key = m_lastResult.Left((size_t)3); key += ' '; @@ -240,7 +250,7 @@ public: : wxSocketInputStream(*sock), m_ftp(ftp_clt) {} virtual ~wxInputFTPStream(void) { - if (Eof()) + if (LastError() != wxStream_NOERROR) m_ftp->GetResult('2'); else m_ftp->Abort(); @@ -256,7 +266,7 @@ public: : wxSocketOutputStream(*sock), m_ftp(ftp_clt) {} virtual ~wxOutputFTPStream(void) { - if (Bad()) + if (LastError() != wxStream_NOERROR) m_ftp->GetResult('2'); else m_ftp->Abort();