summaryrefslogtreecommitdiff
path: root/apt-pkg/tagfile.cc
diff options
context:
space:
mode:
authorJaywalker <jwilliams@nsllc.com>2018-02-06 23:51:41 -0600
committerSam Bingner <sam@bingner.com>2019-08-18 12:07:26 -1000
commitba7b518ea23473b2ae42e397218d35cbce3af645 (patch)
tree05a1ee780fea9a7b4586326a0695e90f4bb7e49f /apt-pkg/tagfile.cc
parent5ab68bbd1aca5b9b3cf23f88d60eebbf84d38e7c (diff)
Added required patches
Diffstat (limited to 'apt-pkg/tagfile.cc')
-rw-r--r--apt-pkg/tagfile.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc
index 14f89f797..1c747fddc 100644
--- a/apt-pkg/tagfile.cc
+++ b/apt-pkg/tagfile.cc
@@ -336,6 +336,14 @@ void pkgTagSection::TrimRecord(bool BeforeRecord, const char*& End, bool Support
}
}
/*}}}*/
+// TagSection::Trim - Trim off any trailing garbage /*{{{*/
+// ---------------------------------------------------------------------
+/* There should be exactly 1 newline at the end of the buffer, no more. */
+void pkgTagSection::Trim()
+{
+ for (; Stop > Section + 2 && (Stop[-2] == '\n' || Stop[-2] == '\r'); Stop--);
+}
+
// TagSection::Exists - return True if a tag exists /*{{{*/
bool pkgTagSection::Exists(StringView Tag) const
{