summaryrefslogtreecommitdiff
path: root/apt-pkg/tagfile.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2013-03-22 21:52:42 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2013-03-22 21:52:42 +0100
commitba6913111f2ae62ad8066d61240fc43df6b3fb88 (patch)
tree09bda0492db2ee547b45c61945ac51a2b7f6866b /apt-pkg/tagfile.cc
parent6b1e33b5447e50af6bac0b2d260b167b28e3e1fd (diff)
parent0c98ee5ade6bb660bf23b09d759e0bb3c52068b9 (diff)
merged lp:~mvo/apt/fix-tagfile-hash
Diffstat (limited to 'apt-pkg/tagfile.cc')
-rw-r--r--apt-pkg/tagfile.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc
index 79811899a..1c79ee74f 100644
--- a/apt-pkg/tagfile.cc
+++ b/apt-pkg/tagfile.cc
@@ -282,10 +282,17 @@ 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(const char* const Tag)
+{
+ unsigned int tmp;
+ return Find(Tag, tmp);
+}
+ /*}}}*/
// TagSection::Find - Locate a tag /*{{{*/
// ---------------------------------------------------------------------
/* This searches the section for a tag that matches the given string. */
-bool pkgTagSection::Find(const char *Tag,unsigned &Pos) const
+bool pkgTagSection::Find(const char *Tag,unsigned int &Pos) const
{
unsigned int Length = strlen(Tag);
unsigned int I = AlphaIndexes[AlphaHash(Tag)];