diff --git a/src/nano.c b/src/nano.c index c81ae68b..c815eda4 100644 --- a/src/nano.c +++ b/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) {