From 5504b35e6c6cfb1cfa098b94e31cda173cc0482a Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 3 Sep 2006 20:50:01 +0000 Subject: [PATCH] Create destination path in Copy instead of source path Initialize Copy::Worker::error to false --- source/copy.cpp | 3 ++- source/copy.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/copy.cpp b/source/copy.cpp index c9cb311..cdbbd48 100644 --- a/source/copy.cpp +++ b/source/copy.cpp @@ -32,7 +32,8 @@ int Copy::check() void Copy::Worker::main() { - Path::mkpath(copy.src.subpath(0, copy.src.size()-1), 0755); + Path::mkpath(copy.dest.subpath(0, copy.dest.size()-1), 0755); + if(unlink(copy.dest.str().c_str())<0 && errno!=ENOENT) { int err=errno; diff --git a/source/copy.h b/source/copy.h index 283ef48..ade21dd 100644 --- a/source/copy.h +++ b/source/copy.h @@ -16,7 +16,7 @@ private: class Worker: public Msp::Thread { public: - Worker(Copy &i): copy(i), done(false) { launch(); } + Worker(Copy &i): copy(i), done(false), error(false) { launch(); } bool get_done() const { return done; } bool get_error() const { return error; } private: -- 2.45.2