Fix CopyDir to not require source and dest paths to end with "/".

This commit is contained in:
comex 2014-11-16 13:54:41 -05:00
parent a225426510
commit a0a80c9a9c
1 changed files with 3 additions and 6 deletions

View File

@ -627,14 +627,11 @@ void CopyDir(const std::string &source_path, const std::string &dest_path)
if (virtualName == "." || virtualName == "..")
continue;
std::string source, dest;
source = source_path + virtualName;
dest = dest_path + virtualName;
std::string source = source_path + DIR_SEP + virtualName;
std::string dest = dest_path + DIR_SEP + virtualName;
if (IsDirectory(source))
{
source += '/';
dest += '/';
if (!File::Exists(dest)) File::CreateFullPath(dest);
if (!File::Exists(dest)) File::CreateFullPath(dest + DIR_SEP);
CopyDir(source, dest);
}
else if (!File::Exists(dest)) File::Copy(source, dest);