mirror of git://git.sv.gnu.org/nano.git
tweaks: move another function, to group the deleting ones together
This commit is contained in:
parent
67e5913edf
commit
a197ccf12d
28
src/nano.c
28
src/nano.c
|
@ -139,6 +139,20 @@ void unlink_node(linestruct *line)
|
|||
delete_node(line);
|
||||
}
|
||||
|
||||
/* Free an entire linked list of linestructs. */
|
||||
void free_lines(linestruct *src)
|
||||
{
|
||||
if (src == NULL)
|
||||
return;
|
||||
|
||||
while (src->next != NULL) {
|
||||
src = src->next;
|
||||
delete_node(src->prev);
|
||||
}
|
||||
|
||||
delete_node(src);
|
||||
}
|
||||
|
||||
/* Make a copy of a linestruct node. */
|
||||
linestruct *copy_node(const linestruct *src)
|
||||
{
|
||||
|
@ -177,20 +191,6 @@ linestruct *copy_buffer(const linestruct *src)
|
|||
return head;
|
||||
}
|
||||
|
||||
/* Free an entire linked list of linestructs. */
|
||||
void free_lines(linestruct *src)
|
||||
{
|
||||
if (src == NULL)
|
||||
return;
|
||||
|
||||
while (src->next != NULL) {
|
||||
src = src->next;
|
||||
delete_node(src->prev);
|
||||
}
|
||||
|
||||
delete_node(src);
|
||||
}
|
||||
|
||||
/* Renumber the lines in a buffer, from the given line onwards. */
|
||||
void renumber_from(linestruct *line)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue