summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2021-03-08 09:21:06 +0000
committerJulian Andres Klode <jak@debian.org>2021-03-08 09:21:06 +0000
commitfbc06b381d14cfa9e2efb4b437b2ce1419e4f1a4 (patch)
tree24a6bc2a81d4b3d7ab716a1f5fd7acb619f0e528 /methods
parent3a7aecd232dfdbcec5dbdc3af16e03479d47d917 (diff)
parent2a81f98b124d8fe551b160df55db1d3bf79a77c1 (diff)
Merge branch 'fix/rredemptypatches' into 'master'
Deal with rred shortcomings around empty patch files See merge request apt-team/apt!159
Diffstat (limited to 'methods')
-rw-r--r--methods/rred.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/methods/rred.cc b/methods/rred.cc
index f53f05ad5..3453bd3bc 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -441,8 +441,12 @@ class Patch {
bool cmdwanted = true;
Change ch(std::numeric_limits<size_t>::max());
- if (f.ReadLine(buffer, sizeof(buffer)) == NULL)
+ if (f.ReadLine(buffer, sizeof(buffer)) == nullptr)
+ {
+ if (f.Eof())
+ return true;
return _error->Error("Reading first line of patchfile %s failed", f.Name().c_str());
+ }
do {
if (h != NULL)
h->Add(buffer);