Fix for issue 452

This commit is contained in:
rfm 2024-11-03 13:15:20 +00:00
parent e960277581
commit 5ea68724ff
2 changed files with 30 additions and 7 deletions

View file

@ -1,3 +1,8 @@
2024-11-03 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSFileManager.m: Fix case where positive result of asking
handler whether to proceed was ignored.
2024-11-01 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSDate.m: Fix returing receiver when earlier/later argument

View file

@ -1386,11 +1386,30 @@ static gs_mutex_t classLock = GS_MUTEX_INIT_STATIC;
if ([self createDirectoryAtPath: destination attributes: attrs] == NO)
{
return [self _proceedAccordingToHandler: handler
forError: [self _lastError]
inPath: destination
fromPath: source
toPath: destination];
if (NO == [self _proceedAccordingToHandler: handler
forError: [self _lastError]
inPath: destination
fromPath: source
toPath: destination])
{
return NO;
}
else
{
BOOL dirOK;
/* We may have managed to create the directory but not set
* its attributes ... if so we can continue copying.
*/
if (![self fileExistsAtPath: destination isDirectory: &dirOK])
{
dirOK = NO;
}
if (!dirOK)
{
return NO;
}
}
}
if ([self _copyPath: source toPath: destination handler: handler] == NO)
@ -3419,8 +3438,7 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
result = NO;
break;
}
/*
* We may have managed to create the directory but not set
/* We may have managed to create the directory but not set
* its attributes ... if so we can continue copying.
*/
if (![self fileExistsAtPath: destinationFile isDirectory: &dirOK])