From: Benno Schulenberg Date: Tue, 24 Nov 2015 13:28:32 +0000 (+0000) Subject: Renaming a variable for clarity. X-Git-Tag: v2.5.0~45 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e0d0ca4b97143fb2846362c40d747c320a3af39d;p=nano.git Renaming a variable for clarity. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5438 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 39b37030..dfc5ceb4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ on the command line does not exist. This fixes Savannah bug #46503. * src/nano.c (splice_node): Inserting a new node into a linked list requires just two parameters: the insertion point and the new node. + * src/nano.c (splice_node): Rename a variable for clarity. 2015-11-23 Benno Schulenberg * src/nano.c (main), src/winio.c (parse_kbinput): Make Ctrl+Left and diff --git a/src/nano.c b/src/nano.c index d515380d..9c95ed81 100644 --- a/src/nano.c +++ b/src/nano.c @@ -94,16 +94,16 @@ filestruct *copy_node(const filestruct *src) return dst; } -/* Splice a node into an existing filestruct. */ -void splice_node(filestruct *begin, filestruct *newnode) +/* Splice a new node into an existing linked list of filestructs. */ +void splice_node(filestruct *afterthis, filestruct *newnode) { - assert(newnode != NULL && begin != NULL); + assert(afterthis != NULL && newnode != NULL); - newnode->next = begin->next; - newnode->prev = begin; - if (begin->next != NULL) - begin->next->prev = newnode; - begin->next = newnode; + newnode->next = afterthis->next; + newnode->prev = afterthis; + if (afterthis->next != NULL) + afterthis->next->prev = newnode; + afterthis->next = newnode; } /* Unlink a node from the rest of the filestruct and delete it. */ diff --git a/src/proto.h b/src/proto.h index 798ef12a..7b085dff 100644 --- a/src/proto.h +++ b/src/proto.h @@ -432,7 +432,7 @@ void do_right(void); /* All functions in nano.c. */ filestruct *make_new_node(filestruct *prevnode); filestruct *copy_node(const filestruct *src); -void splice_node(filestruct *begin, filestruct *newnode); +void splice_node(filestruct *afterthis, filestruct *newnode); void unlink_node(filestruct *fileptr); void delete_node(filestruct *fileptr); filestruct *copy_filestruct(const filestruct *src);