Commit 8ffc33cd authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Finding each zero-length match only once, when doing regex replacements.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5319 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 10 additions and 0 deletions
+10 -0
2015-07-26 Benno Schulenberg <bensberg@justemail.net>
* src/search.c (do_replace_loop): When doing regex replacements, find
each zero-length match only once. This fixes Savannah bug #45626.
2015-07-25 Benno Schulenberg <bensberg@justemail.net>
* src/global.c (shortcut_init, strtosc), src/files.c (savefile),
doc/man/nanorc.5, doc/texinfo/nano.texi: Add a new bindable function,
......
......@@ -757,6 +757,12 @@ ssize_t do_replace_loop(
#endif
}
#ifdef HAVE_REGEX_H
/* Don't find the same zero-length match again. */
if (match_len == 0)
match_len++;
#endif
/* Set the cursor at the last character of the replacement
* text, so searching will resume after the replacement
* text. Note that current_x might be set to (size_t)-1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment