Fix for parsing date format used by some Windows ftp servers.

The code was not correctly parsing dates returned from a Windows ftp
server, causing no files to be reported from the server. The date
format has four digit years and the parsing code expected a two digit
year. This change allows there to be 2 or 4 digit years in the dates.
Task-number: QTBUG-35177

Change-Id: Ibbd7333776f7f998f1cc569a8768a1658bb0a376
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
This commit is contained in:
Jeff Tranter 2013-12-02 13:34:27 -05:00
parent 8f60c8c0ad
commit a2a7f28c0f
1 changed files with 1 additions and 1 deletions

View File

@ -631,7 +631,7 @@ bool QFtpDTP::parseDir(const QByteArray &buffer, const QString &userName, QUrlIn
}
// DOS style FTP servers
QRegExp dosPattern(QLatin1String("^(\\d\\d-\\d\\d-\\d\\d\\ \\ \\d\\d:\\d\\d[AP]M)\\s+"
QRegExp dosPattern(QLatin1String("^(\\d\\d-\\d\\d-\\d\\d\\d?\\d?\\ \\ \\d\\d:\\d\\d[AP]M)\\s+"
"(<DIR>|\\d+)\\s+(\\S.*)$"));
if (dosPattern.indexIn(bufferStr) == 0) {
_q_parseDosDir(dosPattern.capturedTexts(), userName, info);