Skip to content

Commit

Permalink
fix #6346
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Feb 16, 2023
1 parent 7c08e53 commit 554a9e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util/zstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ int zstring::indexofu(zstring const& other, unsigned offset) const {
}

int zstring::last_indexof(zstring const& other) const {
if (other.length() == 0) return length();
if (length() == 0 && other.length() == 0) return 0;
if (other.length() == 0) return -1;
if (other.length() > length()) return -1;
for (unsigned last = length() - other.length() + 1; last-- > 0; ) {
bool suffix = true;
Expand Down

0 comments on commit 554a9e8

Please sign in to comment.