Index: src/OFFileURLHandler.m ================================================================== --- src/OFFileURLHandler.m +++ src/OFFileURLHandler.m @@ -609,14 +609,21 @@ } - (void)of_setLastAccessDate: (OFDate *)lastAccessDate andModificationDate: (OFDate *)modificationDate ofItemAtURL: (OFURL *)URL - attributeKey: (of_file_attribute_key_t)attributeKey attributes: (of_file_attributes_t)attributes { OFString *path = URL.fileSystemRepresentation; + of_file_attribute_key_t attributeKey = (modificationDate != nil + ? of_file_attribute_key_modification_date + : of_file_attribute_key_last_access_date); + + if (lastAccessDate == nil) + lastAccessDate = modificationDate; + if (modificationDate == nil) + modificationDate = lastAccessDate; #ifdef OF_WINDOWS if (func__wutime64 != NULL) { struct __utimbuf64 times = { .actime = @@ -822,29 +829,15 @@ lastAccessDate = [attributes objectForKey: of_file_attribute_key_last_access_date]; modificationDate = [attributes objectForKey: of_file_attribute_key_modification_date]; - if (lastAccessDate != nil || modificationDate != nil) { - of_file_attribute_key_t attributeKey; - - if (modificationDate != nil) - attributeKey = of_file_attribute_key_modification_date; - else - attributeKey = of_file_attribute_key_last_access_date; - - if (lastAccessDate == nil) - lastAccessDate = modificationDate; - if (modificationDate == nil) - modificationDate = lastAccessDate; - + if (lastAccessDate != nil || modificationDate != nil) [self of_setLastAccessDate: lastAccessDate andModificationDate: modificationDate ofItemAtURL: URL - attributeKey: attributeKey attributes: attributes]; - } objc_autoreleasePoolPop(pool); } - (bool)fileExistsAtURL: (OFURL *)URL