ENH: avoid calling fileName::components twice in Foam::cp

This commit is contained in:
Mark Olesen
2017-05-26 10:39:56 +02:00
parent 5efe22c2f0
commit ccc1ce4a25

View File

@ -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 (destFile.type() == fileName::DIRECTORY)
{
destFile = destFile/src.component(src.components().size() -1);
destFile = destFile/src.components().last();
}
// Make sure the destination directory exists.