Преглед изворни кода

StringView: rfind: pos should be end of substr, not start

Gbp-Dch: ignore
Julian Andres Klode пре 10 година
родитељ
комит
0e58689ae7
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      apt-pkg/contrib/string_view.h

+ 1 - 1
apt-pkg/contrib/string_view.h

@@ -57,7 +57,7 @@ public:
 
     size_t rfind(int c, size_t pos=npos) const {
         if (pos != npos)
-            return substr(pos).rfind(c);
+            return substr(0, pos).rfind(c);
 
         const char *found = static_cast<const char*>(memrchr(data_, c, size_));