Skip to content
This repository was archived by the owner on Aug 5, 2024. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix for replace function when needle is greater than 1
  • Loading branch information
towel42-com committed Jan 31, 2024
commit 73ed7c7822d0e89fa4661b38aa1def759c6807b5
2 changes: 1 addition & 1 deletion cpp17/diff_match_patch_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void replace(std::wstring &inString, const std::wstring &from,
std::size_t pos = inString.find(from);
while (pos != std::wstring::npos) {
inString.replace(pos, from.length(), to);
pos = inString.find(from, pos + 1);
pos = inString.find(from, pos + to.length());
}
}

Expand Down