nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit e9ba058f3d160f489a23ed69b0bad25415173a36
parent 9e2a12b62aaefb534d2ffed0864faaf7aed62880
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue, 30 Oct 2018 19:34:03 +0100

tweaks: elide a function that is used just once and is a oneliner

Diffstat:
Msrc/files.c | 2+-
Msrc/nano.c | 6------
Msrc/proto.h | 1-
3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/files.c b/src/files.c @@ -62,7 +62,7 @@ bool has_valid_path(const char *filename) /* Add an item to the circular list of openfile structs. */ void make_new_buffer(void) { - openfilestruct *newnode = make_new_opennode(); + openfilestruct *newnode = nmalloc(sizeof(openfilestruct)); if (openfile == NULL) { /* Make the first open file the only element in the list. */ diff --git a/src/nano.c b/src/nano.c @@ -502,12 +502,6 @@ void copy_from_buffer(filestruct *somebuffer) ingraft_buffer(the_copy); } -/* Create a new openfile node. */ -openfilestruct *make_new_opennode(void) -{ - return (openfilestruct *)nmalloc(sizeof(openfilestruct)); -} - #ifdef ENABLE_MULTIBUFFER /* Unlink a node from the rest of the circular list, and delete it. */ void unlink_opennode(openfilestruct *fileptr) diff --git a/src/proto.h b/src/proto.h @@ -398,7 +398,6 @@ void extract_buffer(filestruct **file_top, filestruct **file_bot, filestruct *top, size_t top_x, filestruct *bot, size_t bot_x); void ingraft_buffer(filestruct *somebuffer); void copy_from_buffer(filestruct *somebuffer); -openfilestruct *make_new_opennode(void); #ifdef ENABLE_MULTIBUFFER void unlink_opennode(openfilestruct *fileptr); void delete_opennode(openfilestruct *fileptr);