diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-09-07 09:32:51 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-09-07 09:32:51 +0200 |
commit | 3580e481e0dcbb4a39d687137eafcda60d8e85d5 (patch) | |
tree | cacd09d1c987a06d6e02581eb8c3afaf1e56ec00 /methods/gzip.cc | |
parent | debca0004bc8b57e487a5a8ffdec51b54ae2f22a (diff) | |
parent | ca07950ec545b41a18cbeff0ec0ba43624592c07 (diff) |
merged from the debian-sid branch
Diffstat (limited to 'methods/gzip.cc')
-rw-r--r-- | methods/gzip.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/methods/gzip.cc b/methods/gzip.cc index 5b9b66b50..22cae9424 100644 --- a/methods/gzip.cc +++ b/methods/gzip.cc @@ -48,12 +48,9 @@ bool GzipMethod::Fetch(FetchItem *Itm) // Open the source and destination files FileFd From(Path,FileFd::ReadOnlyGzip); - // if the file is empty, just rename it and return - if(From.Size() == 0) - { - rename(Path.c_str(), Itm->DestFile.c_str()); - return true; - } + // FIXME add an error message saying that empty files can't be valid archives + if(From.Size() == 0) + return false; FileFd To(Itm->DestFile,FileFd::WriteAtomic); To.EraseOnFailure(); |