From 04fbfaae5172aa1775755309a528aa2b86a5525a Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Sun, 8 Feb 2009 17:45:21 +0000 Subject: [PATCH] 2009-02-08 Chris Allegretta * Add more multidata initliazers for new buffers and 'magic lines'. Fixes segfaults with syntax highlighting in new buffers, initially reported by Mike Frysinger. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4372 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 4 ++++ src/files.c | 4 ++++ src/utils.c | 3 +++ 3 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index c2af11fa..3d11a5cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-02-08 Chris Allegretta + * Add more multidata initliazers for new buffers and 'magic lines'. Fixes segfaults + with syntax highlighting in new buffers, initially reported by Mike Frysinger. + GNU nano 2.1.8 - 2009.02.07 2009-02-06 Chris Allegretta * rcfile.c (parse_include): Abort on being unable to open an included rcfile. Fixes diff --git a/src/files.c b/src/files.c index 2e95010b..ccd3c8de 100644 --- a/src/files.c +++ b/src/files.c @@ -96,6 +96,10 @@ void initialize_buffer_text(void) openfile->edittop = openfile->fileage; openfile->current = openfile->fileage; +#ifdef ENABLE_COLOR + openfile->fileage->multidata = NULL; +#endif + openfile->totsize = 0; } diff --git a/src/utils.c b/src/utils.c index 4ccfc955..3d7f069b 100644 --- a/src/utils.c +++ b/src/utils.c @@ -542,6 +542,9 @@ void new_magicline(void) openfile->filebot->next->prev = openfile->filebot; openfile->filebot->next->next = NULL; openfile->filebot->next->lineno = openfile->filebot->lineno + 1; +#ifdef ENABLE_COLOR + openfile->filebot->next->multidata = NULL; +#endif openfile->filebot = openfile->filebot->next; openfile->totsize++; }