summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/depcache.cc4
-rw-r--r--cmdline/apt-mark.cc4
2 files changed, 4 insertions, 4 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index b19d180a4..322bf1bbe 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -90,10 +90,10 @@ static bool SectionInSubTree(char const * const SubTree, std::string_view Needle
{
if (ConfigValueInSubTree(SubTree, Needle))
return true;
- auto const sub = Needle.find('/');
+ auto const sub = Needle.rfind('/');
if (sub == std::string_view::npos)
{
- std::string special{"<undefined>/"};
+ std::string special{"/"};
special.append(Needle);
return ConfigValueInSubTree(SubTree, special);
}
diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc
index 46d3ca5b8..3f3b008ba 100644
--- a/cmdline/apt-mark.cc
+++ b/cmdline/apt-mark.cc
@@ -163,10 +163,10 @@ static bool SectionInSubTree(char const * const SubTree, std::string_view Needle
{
if (ConfigValueInSubTree(SubTree, Needle))
return true;
- auto const sub = Needle.find('/');
+ auto const sub = Needle.rfind('/');
if (sub == std::string_view::npos)
{
- std::string special{"<undefined>/"};
+ std::string special{"/"};
special.append(Needle);
return ConfigValueInSubTree(SubTree, special);
}