summaryrefslogtreecommitdiff
path: root/apt-pkg/tagfile.cc
diff options
context:
space:
mode:
authorJaywalker <jwilliams@nsllc.com>2018-02-06 23:51:41 -0600
committerJaywalker <jwilliams@nsllc.com>2018-02-06 23:51:41 -0600
commit2d71f8c24d490b5a3773821264124f0ed5c9a9d2 (patch)
tree3b77d056cae38d88a93aeb691d9c5364bedb4b30 /apt-pkg/tagfile.cc
parent3bfcf8ca7023843a9b12de8e58bccab32b4c1a43 (diff)
Fixed system() using coolstar's patch and added other 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 1aa67cc67..4c2a8b6b8 100644
--- a/apt-pkg/tagfile.cc
+++ b/apt-pkg/tagfile.cc
@@ -335,6 +335,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
{