renumber() isn't NULL, and update related comments
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2979
35c25a1d-7b9e-4130-9fde-
d3aeb78583b8
where it's used. (DLR)
do_find_bracket()
- Add comments and minor cleanups. (DLR)
- find_history(), get_history_completion()
+ find_history()
+ - Make parameters const where possible. (DLR)
+ update_history()
+ - Don't renumber the history list starting after the entry we
+ found if the entry we found is at the bottom of the list.
+ (DLR, found by Simon Strandman)
+ get_history_completion()
- Make parameters const where possible. (DLR)
- text.c:
do_word_count()
if (fileptr == NULL)
open_buffer("");
- /* Did we try to insert a file of 0 bytes? */
+ /* Did we try to insert a file of zero bytes? */
if (num_lines != 0) {
if (openfile->current != NULL) {
fileptr->next = openfile->current;
bar = p->next;
unlink_node(foo);
delete_node(foo);
- renumber(bar);
+ if (bar != NULL)
+ renumber(bar);
}
/* If the history is full, delete the beginning entry to make room
- * for the new entry at the end. */
+ * for the new entry at the end. We assume that MAX_SEARCH_HISTORY
+ * is greater than zero. */
if ((*hbot)->lineno == MAX_SEARCH_HISTORY + 1) {
filestruct *foo = *hage;