Skip to content

Commit

Permalink
Merge pull request #39 from arichardson/master
Browse files Browse the repository at this point in the history
Don't attempt to copy files if from == to
  • Loading branch information
auriamg committed Aug 26, 2018
2 parents 3b64f6f + 788339e commit ce13cb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Utils.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit ce13cb5

Please sign in to comment.