From: Chris Allegretta Date: Sun, 15 Nov 2015 07:08:16 +0000 (+0000) Subject: Backport r5398 from trunk. X-Git-Tag: v2.4.3~2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=757fd8384e06ce31f209ed654229a545b1de709e;p=nano.git Backport r5398 from trunk. git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_2_4_branch@5422 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index e9023467..4fea3f53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-11-10 Benno Schulenberg + * src/winio.c (edit_draw): Skip a zero-length match only when there + /is/ a match. Found with valgrind. This fixes Savannah bug #41908. + 2015-11-06 Benno Schulenberg * src/files.c (write_lockfile): Don't bail out when the hostname is overlong, but instead truncate it properly and continue. This fixes diff --git a/src/winio.c b/src/winio.c index 523e3dbd..b1f2dcf9 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2618,7 +2618,7 @@ void edit_draw(filestruct *fileptr, const char *converted, int goto step_two; /* Skip over a zero-length regex match. */ - if (startmatch.rm_so == startmatch.rm_eo) + if (start_line != NULL && startmatch.rm_so == startmatch.rm_eo) startmatch.rm_eo++; else { /* No start found, so skip to the next step. */