summaryrefslogtreecommitdiff
path: root/methods/bzip2.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-09-06 12:17:15 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-09-06 12:17:15 +0200
commitcf1cdb3328dacde829db8bbb3db4f5373ac07d61 (patch)
tree7287684652af4da2c05bf6259a1d65afed17ef90 /methods/bzip2.cc
parent1f8b2599f6beb14e8855f5d43fc1a759a08690e9 (diff)
* methods/{gzip,bzip2}.cc:
- empty files can never be valid archives (Closes: #595691)
Diffstat (limited to 'methods/bzip2.cc')
-rw-r--r--methods/bzip2.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/methods/bzip2.cc b/methods/bzip2.cc
index 241f21c66..c668141a2 100644
--- a/methods/bzip2.cc
+++ b/methods/bzip2.cc
@@ -56,12 +56,9 @@ bool Bzip2Method::Fetch(FetchItem *Itm)
// Open the source and destination files
FileFd From(Path,FileFd::ReadOnly);
- // 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;
int GzOut[2];
if (pipe(GzOut) < 0)