From 788339e038f1f0a6e166e1767a8f3b27c48dcbca Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sat, 25 Aug 2018 18:16:17 +0100 Subject: [PATCH] Don't attempt to copy files if from == to --- src/Utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index aa56624..05ff76e 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -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);