Initializing a newly allocated multidata array.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5447 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
be01647a18
commit
b1d6d7f95c
|
@ -2,6 +2,9 @@
|
||||||
* src/nano.c (main): Allow the user full control over the values of
|
* src/nano.c (main): Allow the user full control over the values of
|
||||||
MALLOC_CHECK_ and MALLOC_PERTURB_; nano shouldn't override these.
|
MALLOC_CHECK_ and MALLOC_PERTURB_; nano shouldn't override these.
|
||||||
This reverts r5344 from August 6.
|
This reverts r5344 from August 6.
|
||||||
|
* src/nano.c (alloc_multidata_if_needed): When allocating a new
|
||||||
|
multidata array, initialize the array. Problem was betrayed by
|
||||||
|
using MALLOC_PERTURB_, and was located with valgrind.
|
||||||
|
|
||||||
2015-11-26 Benno Schulenberg <bensberg@justemail.net>
|
2015-11-26 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/text.c (do_redo): Not just the undoing, also the redoing of a
|
* src/text.c (do_redo): Not just the undoing, also the redoing of a
|
||||||
|
|
|
@ -1849,8 +1849,14 @@ int do_mouse(void)
|
||||||
#ifndef DISABLE_COLOR
|
#ifndef DISABLE_COLOR
|
||||||
void alloc_multidata_if_needed(filestruct *fileptr)
|
void alloc_multidata_if_needed(filestruct *fileptr)
|
||||||
{
|
{
|
||||||
if (!fileptr->multidata)
|
int i;
|
||||||
|
|
||||||
|
if (fileptr->multidata == NULL) {
|
||||||
fileptr->multidata = (short *)nmalloc(openfile->syntax->nmultis * sizeof(short));
|
fileptr->multidata = (short *)nmalloc(openfile->syntax->nmultis * sizeof(short));
|
||||||
|
|
||||||
|
for (i = 0; i < openfile->syntax->nmultis; i++)
|
||||||
|
fileptr->multidata[i] = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Precalculate the multi-line start and end regex info so we can
|
/* Precalculate the multi-line start and end regex info so we can
|
||||||
|
|
Loading…
Reference in New Issue