summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/depcache.cc4
-rw-r--r--cmdline/apt-mark.cc4
-rwxr-xr-xtest/integration/test-apt-get-update-sourceslist-warning2
3 files changed, 5 insertions, 5 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);
}
diff --git a/test/integration/test-apt-get-update-sourceslist-warning b/test/integration/test-apt-get-update-sourceslist-warning
index 60c8d7308..02e1ccb29 100755
--- a/test/integration/test-apt-get-update-sourceslist-warning
+++ b/test/integration/test-apt-get-update-sourceslist-warning
@@ -21,11 +21,11 @@ Architectures: amd64
Components: main contrib non-free non-free-firmware
Description: Debian x.y Bookworm - Not Released
EOF
-chmod 644 rootdir/var/lib/apt/lists/example.org_debian_dists_bookworm_Release
touch rootdir/var/lib/apt/lists/example.org_debian_dists_bookworm_main_binary-amd64_Packages
touch rootdir/var/lib/apt/lists/example.org_debian_dists_bookworm_contrib_binary-amd64_Packages
touch rootdir/var/lib/apt/lists/example.org_debian_dists_bookworm_non-free_binary-amd64_Packages
touch rootdir/var/lib/apt/lists/example.org_debian_dists_bookworm_non-free-firmware_binary-amd64_Packages
+find rootdir/var/lib/apt/lists/ -type f -exec chmod 644 {} \;
NOTESURL='https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.html#non-free-split'
BOILERPLATE='Reading package lists...