mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Allow null as a destination file name argument for CopyTo in nsLocalFileOSX. b=478549 r=mbanner sr=roc
This commit is contained in:
parent
af1a76731a
commit
018ca06ce3
@ -2227,11 +2227,15 @@ nsresult nsLocalFile::CopyInternal(nsIFile* aParentDir,
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
CFStringRef destNameStr = ::CFStringCreateWithCharacters(kCFAllocatorDefault,
|
||||
PromiseFlatString(newName).get(),
|
||||
newName.Length());
|
||||
CFStringRef destNameStr = NULL;
|
||||
if (newName.Length() > 0) {
|
||||
destNameStr = ::CFStringCreateWithCharacters(kCFAllocatorDefault,
|
||||
PromiseFlatString(newName).get(),
|
||||
newName.Length());
|
||||
}
|
||||
err = ::FSCopyObjectSync(&srcFSRef, &destFSRef, destNameStr, NULL, kFSFileOperationDefaultOptions);
|
||||
::CFRelease(destNameStr);
|
||||
if (destNameStr)
|
||||
::CFRelease(destNameStr);
|
||||
|
||||
return MacErrorMapper(err);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user