diff options
Diffstat (limited to 'apt-pkg/tagfile.cc')
-rw-r--r-- | apt-pkg/tagfile.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 52000c6b9..047f88986 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -626,6 +626,11 @@ bool pkgTagSection::Exists(StringView Tag) const unsigned int tmp; return Find(Tag, tmp); } +bool pkgTagSection::Exists(Key key) const +{ + unsigned int tmp; + return Find(key, tmp); +} /*}}}*/ // TagSection::Find - Locate a tag /*{{{*/ // --------------------------------------------------------------------- @@ -1051,8 +1056,8 @@ bool pkgTagSection::Write(FileFd &File, char const * const * const Order, std::v { if (R->Action == Tag::REMOVE) continue; - std::string const name = ((R->Action == Tag::RENAME) ? R->Data : R->Name); - if (Exists(name.c_str())) + auto const name = ((R->Action == Tag::RENAME) ? R->Data : R->Name); + if (Exists(name)) continue; if (Order != NULL) { |