Commit 0b5100f7 authored by Mark Olesen's avatar Mark Olesen
Browse files

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

parent 4b32238d
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment