.mk as Makefiles. Suggested by Emmanuel Bourg in Debian bug #804845.
* src/color.c (color_update): Tell the user when a syntax name given
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.
2015-11-23 Benno Schulenberg <bensberg@justemail.net>
* src/nano.c (main), src/winio.c (parse_kbinput): Make Ctrl+Left and
}
/* Splice a node into an existing filestruct. */
-void splice_node(filestruct *begin, filestruct *newnode, filestruct
- *end)
+void splice_node(filestruct *begin, filestruct *newnode)
{
assert(newnode != NULL && begin != NULL);
- newnode->next = end;
+ newnode->next = begin->next;
newnode->prev = begin;
+ if (begin->next != NULL)
+ begin->next->prev = newnode;
begin->next = newnode;
- if (end != NULL)
- end->prev = newnode;
}
/* Unlink a node from the rest of the filestruct and delete it. */
/* All functions in nano.c. */
filestruct *make_new_node(filestruct *prevnode);
filestruct *copy_node(const filestruct *src);
-void splice_node(filestruct *begin, filestruct *newnode, filestruct
- *end);
+void splice_node(filestruct *begin, filestruct *newnode);
void unlink_node(filestruct *fileptr);
void delete_node(filestruct *fileptr);
filestruct *copy_filestruct(const filestruct *src);
/* Add the new entry to the end. */
(*hbot)->data = mallocstrcpy((*hbot)->data, s);
- splice_node(*hbot, make_new_node(*hbot), (*hbot)->next);
+ splice_node(*hbot, make_new_node(*hbot));
*hbot = (*hbot)->next;
(*hbot)->data = mallocstrcpy(NULL, "");
data[u->mark_begin_x] = '\0';
free(f->data);
f->data = data;
- splice_node(f, t, f->next);
+ splice_node(f, t);
if (f == openfile->filebot)
openfile->filebot = t;
goto_line_posx(u->lineno, u->begin);
data[u->begin] = '\0';
free(f->data);
f->data = data;
- splice_node(f, shoveline, f->next);
+ splice_node(f, shoveline);
if (f == openfile->filebot)
openfile->filebot = shoveline;
renumber(shoveline);
#endif
openfile->current_x = extra;
- splice_node(openfile->current, newnode, openfile->current->next);
+ splice_node(openfile->current, newnode);
if (openfile->current == openfile->filebot)
openfile->filebot = newnode;
/* Make a new line, and copy the text after where we're
* going to break this line to the beginning of the new
* line. */
- splice_node(openfile->current,
- make_new_node(openfile->current),
- openfile->current->next);
+ splice_node(openfile->current, make_new_node(openfile->current));
/* If this paragraph is non-quoted, and autoindent isn't
* turned on, set the indentation length to zero so that the