]> git.wh0rd.org Git - nano.git/commitdiff
Backport r5398 from trunk.
authorChris Allegretta <chrisa@asty.org>
Sun, 15 Nov 2015 07:08:16 +0000 (07:08 +0000)
committerChris Allegretta <chrisa@asty.org>
Sun, 15 Nov 2015 07:08:16 +0000 (07:08 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_2_4_branch@5422 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/winio.c

index e9023467d50d52746ffa796af6df462ff8bf481a..4fea3f53c60733e0b77e09a0623ae03c632ade6a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-11-10  Benno Schulenberg  <bensberg@justemail.net>
+       * 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  <bensberg@justemail.net>
        * src/files.c (write_lockfile): Don't bail out when the hostname is
        overlong, but instead truncate it properly and continue.  This fixes
index 523e3dbdce022b7c7207783e34e4da7772ba67d6..b1f2dcf999512406b68e73c63ce1647d6db03cc7 100644 (file)
@@ -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. */