Skip to content

Commit

Permalink
Fix for issue 452
Browse files Browse the repository at this point in the history
  • Loading branch information
rfm committed Nov 3, 2024
1 parent e960277 commit 5ea6872
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2024-11-03 Richard Frith-Macdonald <[email protected]>

* Source/NSFileManager.m: Fix case where positive result of asking
handler whether to proceed was ignored.

2024-11-01 Richard Frith-Macdonald <[email protected]>

* Source/NSDate.m: Fix returing receiver when earlier/later argument
Expand Down
32 changes: 25 additions & 7 deletions Source/NSFileManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -1386,11 +1386,30 @@ - (BOOL) copyPath: (NSString*)source

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)
Expand Down Expand Up @@ -3419,8 +3438,7 @@ - (BOOL) _copyPath: (NSString*)source
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])
Expand Down

0 comments on commit 5ea6872

Please sign in to comment.