[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bkdelibs/KDE/4=2E6=5D_kioslave/ftp=3A_Allow_copying_?=
From:       Dawit Alemayehu <adawit () kde ! org>
Date:       2011-03-18 17:35:03
Message-ID: 20110318173503.BD071A60B4 () git ! kde ! org
[Download RAW message or body]

Git commit 0a0368bac3e1586328f6d0869f62ef14687906ea by Dawit Alemayehu.
Committed on 18/03/2011 at 17:57.
Pushed by adawit into branch 'KDE/4.6'.

Allow copying of zero byte sized files.

BUG:184594
FIXED-IN:4.6.2

M  +5    -4    kioslave/ftp/ftp.cpp     

http://commits.kde.org/kdelibs/0a0368bac3e1586328f6d0869f62ef14687906ea

diff --git a/kioslave/ftp/ftp.cpp b/kioslave/ftp/ftp.cpp
index ca0ba61..95c4450 100644
--- a/kioslave/ftp/ftp.cpp
+++ b/kioslave/ftp/ftp.cpp
@@ -2142,11 +2142,12 @@ bool Ftp::ftpSize( const QString & path, char mode )
     return false;
 
   // skip leading "213 " (response code)
-  const char* psz = ftpResponse(4);
-  if(!psz)
+  QByteArray psz (ftpResponse(4));
+  if(psz.isEmpty())
     return false;
-  m_size = charToLongLong(psz);
-  if (!m_size) m_size = UnknownSize;
+  bool ok = false;
+  m_size = psz.trimmed().toLongLong(&ok);
+  if (!ok) m_size = UnknownSize;
   return true;
 }
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic