add DB's fix for a do_replace_loop() segfault

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1627 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2004-01-15 05:47:03 +00:00
parent 3e3fab5a0f
commit 41151ac50d
2 changed files with 6 additions and 1 deletions

View File

@ -9,6 +9,11 @@ CVS code -
- Move the call to raw() on systems that don't define
_POSIX_VDISABLE outside the main input/output loop, as it
doesn't need to be called every time through the loop. (DLR)
- search.c:
do_replace_loop()
- Fix segfault when doing a regex replace of a string that
matches inside a line (e.g. replace the "b" in "abc" with
anything). (David Benbennick)
- winio.c:
do_credits()
- Use nanosleep() instead of usleep(). The latter is only

View File

@ -722,7 +722,7 @@ int do_replace_loop(const char *prevanswer, const filestruct *begin,
#ifdef HAVE_REGEX_H
/* Set the bol_eol flag if we're doing a bol and/or eol regex
* replace ("^", "$", or "^$"). */
if (ISSET(USE_REGEXP) && regexec(&search_regexp, prevanswer, 1, NULL, REG_NOTBOL | REG_NOTEOL) == REG_NOMATCH)
if (ISSET(USE_REGEXP) && regexec(&search_regexp, prevanswer, 0, NULL, REG_NOTBOL | REG_NOTEOL) == REG_NOMATCH)
bol_eol = 1;
#endif