[Github-comments] [geany/geany-plugins] Markdown: Modify replace_all to avoid infinite loop (PR #1128)
xiota
notifications at xxxxx
Fri Oct 29 05:39:40 UTC 2021
This PR modifies `replace_all` to avoid the infinite loop described in #936. In each iteration, `replace_all` searches for `needle` starting from the beginning of `haystack`. If `replacement` contains `needle`, the result is an infinite loop. To prevent this from happening, `replace_all` is should continue searching for `needle` from the end of the previous `replacement`.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany-plugins/pull/1128
-- Commit Summary --
* <a href="https://github.com/geany/geany-plugins/pull/1128/commits/187c3e2ac40abe91edcb92d522db242192784086">Markdown: Modify replace_all to avoid infinite loop.</a>
-- File Changes --
M markdown/src/viewer.c (6)
-- Patch Links --
https://github.com/geany/geany-plugins/pull/1128.patch
https://github.com/geany/geany-plugins/pull/1128.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1128
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211028/12ed50d6/attachment.htm>
More information about the Github-comments
mailing list