]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed compilation problem in SetTimes
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 30 Oct 2001 15:34:15 +0000 (15:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 30 Oct 2001 15:34:15 +0000 (15:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/filename.cpp

index 34fafde83d8a2df7c3ba64b1e4a43bc85e02dee2..d3f34e5aa2e9e7a573a3cf850093753fd68e04f8 100644 (file)
@@ -899,9 +899,17 @@ bool wxFileName::SetTimes(const wxDateTime *dtCreate,
                           const wxDateTime *dtMod)
 {
 #if defined(__UNIX_LIKE__)
+    if ( !dtAccess && !dtMod )
+    {
+        // can't modify the creation time anyhow, don't try
+        return TRUE;
+    }
+
+    // if dtAccess or dtMod is not specified, use the other one (which must be
+    // non NULL because of the test above) for both times
     utimbuf utm;
-    utm.actime = dtAccess ? dtAccess : dtAccess->GetTicks();
-    utm.modtime = dtMod ? dtMod : dtMod->GetTicks();
+    utm.actime = dtAccess ? dtAccess->GetTicks() : dtMod->GetTicks();
+    utm.modtime = dtMod ? dtMod->GetTicks() : dtAccess->GetTicks();
     if ( utime(GetFullPath(), &utm) == 0 )
     {
         return TRUE;