Blame SOURCES/lftp-4.4.8-overwrite.patch
|
|
373a02 |
diff -up lftp-4.4.8/src/FileCopy.cc.overwrite lftp-4.4.8/src/FileCopy.cc
|
|
|
373a02 |
--- lftp-4.4.8/src/FileCopy.cc.overwrite 2013-11-28 10:42:18.374656024 +0100
|
|
|
373a02 |
+++ lftp-4.4.8/src/FileCopy.cc 2013-11-28 10:42:58.224631188 +0100
|
|
|
373a02 |
@@ -1414,7 +1414,7 @@ int FileCopyPeerFDStream::Do()
|
|
|
373a02 |
{
|
|
|
373a02 |
const char *new_name=dir_file(dirname(stream->full_name),suggested_filename);
|
|
|
373a02 |
struct stat st;
|
|
|
373a02 |
- if(lstat(new_name,&st)==-1 && errno==ENOENT) {
|
|
|
373a02 |
+ if((lstat(new_name,&st)==-1 && errno==ENOENT) || ResMgr::QueryBool("xfer:clobber",0)) {
|
|
|
373a02 |
debug((5,"copy: renaming `%s' to `%s'\n",stream->full_name.get(),suggested_filename.get()));
|
|
|
373a02 |
if(rename(stream->full_name,new_name)==-1)
|
|
|
373a02 |
debug((3,"rename(%s, %s): %s\n",stream->full_name.get(),new_name,strerror(errno)));
|