summaryrefslogtreecommitdiff
path: root/apt-pkg/tagfile.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2019-02-01 14:51:56 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2019-02-01 14:51:56 +0100
commit5caa8cac3bc0ffa8b5360f3e5d5c84e710eb394b (patch)
tree5b0c4a1c2a96db9723abe45685bd5db478df7c1e /apt-pkg/tagfile.cc
parenta1d9debedcba071d708b3019b5a649314cccb1f6 (diff)
Step over empty sections in TagFiles with comments
Implementing a parser with recursion isn't the best idea, but in practice we should get away with it for the time being to avoid needless codechurn. Closes: #920317 #921037
Diffstat (limited to 'apt-pkg/tagfile.cc')
-rw-r--r--apt-pkg/tagfile.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc
index 98001afd1..1e7f2867c 100644
--- a/apt-pkg/tagfile.cc
+++ b/apt-pkg/tagfile.cc
@@ -250,8 +250,12 @@ bool pkgTagFile::Step(pkgTagSection &Tag)
d->chunks.erase(d->chunks.begin(), first);
}
- Tag.Trim();
- return true;
+ if ((d->Flags & pkgTagFile::SUPPORT_COMMENTS) == 0 || Tag.Count() != 0)
+ {
+ Tag.Trim();
+ return true;
+ }
+ return Step(Tag);
}
/*}}}*/
// TagFile::Fill - Top up the buffer /*{{{*/