Index: src/nano.c =================================================================== --- src/nano.c (revision 5136) +++ src/nano.c (working copy) @@ -179,6 +179,7 @@ ssize_t line; assert(fileptr != NULL); + if (fileptr == NULL) return; line = (fileptr->prev == NULL) ? 0 : fileptr->prev->lineno; @@ -365,7 +366,6 @@ /* Renumber starting with the line after the original * file_bot. */ - if (file_bot_save->next != NULL) renumber(file_bot_save->next); } Index: src/search.c =================================================================== --- src/search.c (revision 5136) +++ src/search.c (working copy) @@ -1373,7 +1373,6 @@ bar = p->next; unlink_node(foo); delete_node(foo); - if (bar != NULL) renumber(bar); }