From: Jay Freeman (saurik) Date: Fri, 30 Dec 2016 20:50:56 +0000 (-0800) Subject: Fix field-without-values appearing at end of file. X-Git-Tag: cydia_1.1.28%b4~3 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/4f1e54bea150c1db7b391d115ce19192463430d4 Fix field-without-values appearing at end of file. --- diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 76e18bf4c..c5c668fd3 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -276,10 +276,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; }