diff --git a/src/files.c b/src/files.c index c16ebcb1..83aac9ab 100644 --- a/src/files.c +++ b/src/files.c @@ -642,6 +642,26 @@ void switch_to_next_buffer(void) redecorate_after_switch(); } +/* Unlink a node from the rest of the circular list, and delete it. */ +void unlink_opennode(openfilestruct *fileptr) +{ + if (fileptr == startfile) + startfile = startfile->next; + + fileptr->prev->next = fileptr->next; + fileptr->next->prev = fileptr->prev; + + free(fileptr->filename); + free_lines(fileptr->filetop); +#ifndef NANO_TINY + free(fileptr->current_stat); + free(fileptr->lock_filename); + /* Free the undo stack. */ + discard_until(NULL, fileptr, TRUE); +#endif + free(fileptr); +} + /* Remove the current buffer from the circular list of buffers. */ void close_buffer(void) { diff --git a/src/nano.c b/src/nano.c index ef23a89b..1924c54b 100644 --- a/src/nano.c +++ b/src/nano.c @@ -453,28 +453,6 @@ void copy_from_buffer(linestruct *somebuffer) ingraft_buffer(the_copy); } -#ifdef ENABLE_MULTIBUFFER -/* Unlink a node from the rest of the circular list, and delete it. */ -void unlink_opennode(openfilestruct *fileptr) -{ - if (fileptr == startfile) - startfile = startfile->next; - - fileptr->prev->next = fileptr->next; - fileptr->next->prev = fileptr->prev; - - free(fileptr->filename); - free_lines(fileptr->filetop); -#ifndef NANO_TINY - free(fileptr->current_stat); - free(fileptr->lock_filename); - /* Free the undo stack. */ - discard_until(NULL, fileptr, TRUE); -#endif - free(fileptr); -} -#endif /* ENABLE_MULTIBUFFER */ - /* Display a warning about a key disabled in view mode. */ void print_view_warning(void) { diff --git a/src/proto.h b/src/proto.h index dccfdf6d..e992ac88 100644 --- a/src/proto.h +++ b/src/proto.h @@ -398,9 +398,6 @@ void unpartition_buffer(); void extract(linestruct *top, size_t top_x, linestruct *bot, size_t bot_x); void ingraft_buffer(linestruct *somebuffer); void copy_from_buffer(linestruct *somebuffer); -#ifdef ENABLE_MULTIBUFFER -void unlink_opennode(openfilestruct *fileptr); -#endif void print_view_warning(void); void show_restricted_warning(void); #ifndef ENABLE_HELP