From 3284c6c6f38a087540e46766f2f6303f13c36ae9 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Fri, 26 Apr 2019 13:43:54 +1000 Subject: [PATCH] RemoteLinux: Fix off-by-one error for stat %Y last modified column MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The -t parameter on GNU stat uses the format: %n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o The -t parameter on BusyBox stat uses the format: %n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o BusyBox doesn't support %W so it is not included when using -t. It was incorrectly referring to %Z (time of last status change, seconds since Epoch) because it did not take into account the first column being removed. Subtract 1 from the index so that it takes this into account and correctly refers to %Y (time of last data modification, seconds since Epoch). Task-number: QTCREATORBUG-22041 Change-Id: I272609facbd8148199d2bfcf6f5adbdc273a6b50 Reviewed-by: André Hartmann Reviewed-by: Christian Kandeler --- src/plugins/remotelinux/genericdirectuploadservice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/remotelinux/genericdirectuploadservice.cpp b/src/plugins/remotelinux/genericdirectuploadservice.cpp index 37cb14c7f2e..014ed5db620 100644 --- a/src/plugins/remotelinux/genericdirectuploadservice.cpp +++ b/src/plugins/remotelinux/genericdirectuploadservice.cpp @@ -158,7 +158,7 @@ QDateTime GenericDirectUploadService::timestampFromStat(const DeployableFile &fi return QDateTime(); } bool isNumber; - const qint64 secsSinceEpoch = columns.at(12).toLongLong(&isNumber); + const qint64 secsSinceEpoch = columns.at(11).toLongLong(&isNumber); if (!isNumber) { emit warningMessage(warningString); return QDateTime();