[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] Reducing number of parameters in splice_opennode()
From: |
Benno Schulenberg |
Subject: |
Re: [Nano-devel] Reducing number of parameters in splice_opennode() |
Date: |
Tue, 23 Feb 2016 20:09:17 +0100 |
On Thu, Feb 18, 2016, at 14:22, Rishabh Dave wrote:
> Attached patch includes changes in splice_opennode() which are same as
> those that were made in splice_node() in revision 5437 & revision 5438.
Did you test this?
When I run src/nano (with the patch applied), I get a segfault.
Which I don't understand, but valgrind says a conditional jump
depends on uninitialized memory...
The difference between the list of openfile nodes and the list
of filestructs is that the first is circular. That makes splicing
difficult when the circle is empty and you want to 'splice' in
the first element.
Easiest solution is: don't splice the first element, just set it
up manually. See attached patch.
(Next step would be: elide this whole splicing function as it's
used only once.)
Benno
--
http://www.fastmail.com - Send your email first class
simplify-splicing.patch
Description: Text Data