diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:59:16 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:59:16 +0000 |
commit | f5ec3b68c582138acce7c5a93e473dde50ab8354 (patch) | |
tree | fb93bfd27807a456c813e2506d1c39b24188dca2 | |
parent | 0077d829b7c3a7d012e8eb1a6cc36ae1f07f3834 (diff) |
Fix last fix, make sure we read something before giving up
Author: jgg
Date: 2002-05-30 04:19:48 GMT
Fix last fix, make sure we read something before giving up
-rw-r--r-- | apt-pkg/tagfile.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index ab3647fd8..d58409bfb 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: tagfile.cc,v 1.32 2002/03/26 07:22:31 jgg Exp $ +// $Id: tagfile.cc,v 1.33 2002/05/30 04:19:48 jgg Exp $ /* ###################################################################### Fast scanner for RFC-822 type header information @@ -85,6 +85,7 @@ bool pkgTagFile::Step(pkgTagSection &Tag) bool pkgTagFile::Fill() { unsigned long EndSize = End - Start; + unsigned long Actual; memmove(Buffer,Start,EndSize); Start = Buffer; @@ -93,7 +94,6 @@ bool pkgTagFile::Fill() if (Done == false) { // See if only a bit of the file is left - unsigned long Actual; if (Fd.Read(End,Size - (End - Buffer),&Actual) == false) return false; if (Actual != Size - (End - Buffer)) @@ -103,7 +103,7 @@ bool pkgTagFile::Fill() if (Done == true) { - if (EndSize <= 3) + if (EndSize <= 3 && Actual == 0) return false; if (Size - (End - Buffer) < 4) return true; |