diff options
| author | Julian Andres Klode <jak@debian.org> | 2026-04-08 10:26:06 +0000 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2026-04-08 10:26:06 +0000 |
| commit | a6873075dcac5115706e001bc9640c8da0805e35 (patch) | |
| tree | e5d3d569e51d24207eb0228615f5eedd37e08296 /apt-pkg/aptconfiguration.cc | |
| parent | 04dcfd52355ca06143a8aaca4afd718a22fb0ded (diff) | |
| parent | af5b9453a1908021cf75c348522c1a12eeb0dee4 (diff) | |
Merge branch 'str-to-chars' into 'main'
apt: funcs called with a string literal consisting of a single character
See merge request apt-team/apt!563
Diffstat (limited to 'apt-pkg/aptconfiguration.cc')
| -rw-r--r-- | apt-pkg/aptconfiguration.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index a0164c6c3..fb6bcdb6d 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -175,8 +175,8 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All, builtin.push_back("none"); for (struct dirent *Ent = readdir(D); Ent != 0; Ent = readdir(D)) { string const name = SubstVar(Ent->d_name, "%5f", "_"); - size_t const foundDash = name.rfind("-"); - size_t const foundUnderscore = name.rfind("_", foundDash); + size_t const foundDash = name.rfind('-'); + size_t const foundUnderscore = name.rfind('_', foundDash); if (foundDash == string::npos || foundUnderscore == string::npos || foundDash <= foundUnderscore || name.substr(foundUnderscore+1, foundDash-(foundUnderscore+1)) != "Translation") @@ -692,7 +692,7 @@ std::string Configuration::color(std::string const &colorName, std::string const // | \\x1B<word> ; color escaped. // | <word> ; a simple color name // | <color> <color> ; a sequence of colors - if (color.find(" ") != color.npos) + if (color.find(' ') != color.npos) { std::string res; for (auto &&colorPart : VectorizeString(color, ' ')) |
