tweaks: move another function, to group the deleting ones together
Этот коммит содержится в:
родитель
67e5913edf
Коммит
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)
|
||||
{
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user