From: David Kalnischkies <kalnischkies@gmail.com>
Date: Tue, 8 Sep 2009 21:11:11 +0000 (+0200)
Subject: add text at the top without failing in rred (Closes: #545694)
X-Git-Tag: 0.7.24~4^2~11
X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/ebf2e25b204195892b6c4866b1517755efb590b4

add text at the top without failing in rred (Closes: #545694)
Patch from Bernhard R. Link, thanks!
---

diff --git a/debian/changelog b/debian/changelog
index eebef40ff..9aa1f6860 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,6 +31,8 @@ apt (0.7.24) UNRELEASED; urgency=low
     - move the description of files to globally usable entities
   * doc/apt_preferences.5.xml:
     - document the new preferences.d folder (Closes: #544017)
+  * methods/rred.cc:
+    - add at the top without failing (by Bernhard R. Link, Closes: #545694)
 
  -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 28 Aug 2009 09:40:08 +0200
 
diff --git a/methods/rred.cc b/methods/rred.cc
index 6fa57f3a6..27d95bdde 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -174,7 +174,7 @@ int RredMethod::ed_file(FILE *ed_cmds, FILE *in_file, FILE *out_file,
          hash);
    
    /* read the rest from infile */
-   if (result > 0) {
+   if (result >= 0) {
       while (fgets(buffer, BUF_SIZE, in_file) != NULL) {
          written = fwrite(buffer, 1, strlen(buffer), out_file);
          hash->Add((unsigned char*)buffer, written);