From 596ddf0c783d440e4817d928c0755d50262e0900 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 30 Dec 2016 12:50:56 -0800 Subject: Fix field-without-values appearing at end of file. --- apt-pkg/tagfile.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 34cd721c6..250f7ac17 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -277,10 +277,8 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength,bool const Su // find the beginning of the value Stop = Colon + 1; for (; Stop < End && isspace_ascii(*Stop) != 0; ++Stop) - if (*Stop == '\n' && Stop[1] != ' ') + if (*Stop == '\n' && (Stop+1 == End || Stop[1] != ' ')) break; - if (Stop >= End) - return false; lastTagData.StartValue = Stop - Section; } -- cgit v1.2.3