summaryrefslogtreecommitdiff
path: root/methods/gzip.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2010-09-06 18:11:49 +0200
committerMichael Vogt <mvo@debian.org>2010-09-06 18:11:49 +0200
commitfb031c5598c529b98477c47eac6fe11cae4b1b66 (patch)
treede7908c98e8086a148c423e6edb3d8a6e7455491 /methods/gzip.cc
parenteb1115ef4e84b90189a50c15af4002e4e7306c01 (diff)
parent7753e4684e2b80abbed296b90f47be12b4fce8fc (diff)
merged from lp:~donkult/apt/sid
Diffstat (limited to 'methods/gzip.cc')
-rw-r--r--methods/gzip.cc9
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();