diff --git a/ChangeLog b/ChangeLog index 9e46b63d5fb40522e7c68775c80bd9675ed03aac..faa272349e4ee0166b3ef10ec47955d311751bd8 100644 --- 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-08 Benno Schulenberg <bensberg@justemail.net> * src/global.c (shortcut_init): Allow exiting from the file browser with the same key (^T) as it was entered (as ^G for the help viewer). diff --git a/src/winio.c b/src/winio.c index 530254055f74d9dbe1516a7db4ea3aeaab169394..6b8e52712433bf34993777f5906b0cb89a3c731a 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2613,7 +2613,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 { /* If no start was found, skip to the next step. */