Merge pull request #39 from arichardson/master

Don't attempt to copy files if from == to
This commit is contained in:
auriamg 2018-08-25 21:57:08 -04:00 committed by GitHub
commit ce13cb585e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -104,12 +104,12 @@ void copyFile(string from, string to)
exit(1);
}
}
string override_permission = string(override ? "-f " : "-n ");
// copy file to local directory
string command = string("cp ") + override_permission + from + string(" ") + to;
if( systemp( command ) != 0 )
if( from != to && systemp( command ) != 0 )
{
cerr << "\n\nError : An error occured while trying to copy file " << from << " to " << to << endl;
exit(1);