Bug 807555 - FTP handle case where server reply is missing directory. r=michal
authorJason Duell <jduell.mcbugs@gmail.com>
Mon, 05 Nov 2012 15:39:31 -0800
changeset 112362 49258354b9d027a533cedc7b17f8d19bf349b047
parent 112361 475ae0fac54edc699ae90f9be2296341ba48bc9c
child 112363 c66d2bc6e91bb7f8770ebac945095af3a515e7d0
push id23812
push useremorley@mozilla.com
push dateTue, 06 Nov 2012 14:01:34 +0000
treeherdermozilla-central@f4aeed115e54 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal
bugs807555
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 807555 - FTP handle case where server reply is missing directory. r=michal
netwerk/protocol/ftp/nsFtpConnectionThread.cpp
--- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
+++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
@@ -836,17 +836,17 @@ nsFtpState::R_pwd() {
     int32_t pos = respStr.FindChar('"');
     if (pos > -1) {
         respStr.Cut(0, pos+1);
         pos = respStr.FindChar('"');
         if (pos > -1) {
             respStr.Truncate(pos);
             if (mServerType == FTP_VMS_TYPE)
                 ConvertDirspecFromVMS(respStr);
-            if (respStr.Last() != '/')
+            if (respStr.IsEmpty() || respStr.Last() != '/')
                 respStr.Append('/');
             mPwd = respStr;
         }
     }
     return FTP_S_TYPE;
 }
 
 nsresult