mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: avoid calling fileName::components twice in Foam::cp
This commit is contained in:
@ -770,7 +770,7 @@ bool Foam::cp(const fileName& src, const fileName& dest, const bool followLink)
|
|||||||
// If dest is a directory, create the destination file name.
|
// If dest is a directory, create the destination file name.
|
||||||
if (destFile.type() == fileName::DIRECTORY)
|
if (destFile.type() == fileName::DIRECTORY)
|
||||||
{
|
{
|
||||||
destFile = destFile/src.component(src.components().size() -1);
|
destFile = destFile/src.components().last();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the destination directory exists.
|
// Make sure the destination directory exists.
|
||||||
|
|||||||
Reference in New Issue
Block a user