fixed compilation problem in SetTimes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -899,9 +899,17 @@ bool wxFileName::SetTimes(const wxDateTime *dtCreate,
|
|||||||
const wxDateTime *dtMod)
|
const wxDateTime *dtMod)
|
||||||
{
|
{
|
||||||
#if defined(__UNIX_LIKE__)
|
#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;
|
utimbuf utm;
|
||||||
utm.actime = dtAccess ? dtAccess : dtAccess->GetTicks();
|
utm.actime = dtAccess ? dtAccess->GetTicks() : dtMod->GetTicks();
|
||||||
utm.modtime = dtMod ? dtMod : dtMod->GetTicks();
|
utm.modtime = dtMod ? dtMod->GetTicks() : dtAccess->GetTicks();
|
||||||
if ( utime(GetFullPath(), &utm) == 0 )
|
if ( utime(GetFullPath(), &utm) == 0 )
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Reference in New Issue
Block a user