remove a redundant check in get_history_newer(), and add a few comment

fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2493 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2005-04-29 03:24:43 +00:00
parent 5e360dc065
commit 10f880c62f
3 changed files with 13 additions and 10 deletions

View File

@ -35,6 +35,9 @@ CVS code -
do_output()
- Properly allow wrapping when we insert a tab, for consistency.
(DLR)
- search.c:
get_history_newer()
- Remove redundant check. (DLR)
- utils.c:
num_of_digits()
- Use a size_t instead of an int, and rename to digits(). (DLR)

View File

@ -1215,8 +1215,7 @@ char *get_history_newer(historyheadtype *h)
{
if (h->current->prev != NULL) {
h->current = h->current->prev;
if (h->current->prev != NULL)
return h->current->data;
return h->current->data;
}
return NULL;
}

View File

@ -2450,12 +2450,12 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *def,
char *complete = NULL;
int last_kbinput = 0;
/* This variable is used in the search history code. use_cb == 0
means that we're using the existing history and ignoring
currentbuf. use_cb == 1 means that the entry in answer should be
moved to currentbuf or restored from currentbuf to answer.
use_cb == 2 means that the entry in currentbuf should be moved to
answer or restored from answer to currentbuf. */
/* This variable is used in the search history code. use_cb == 0
* means that we're using the existing history and ignoring
* currentbuf. use_cb == 1 means that the entry in answer should be
* moved to currentbuf or restored from currentbuf to answer.
* use_cb == 2 means that the entry in currentbuf should be moved to
* answer or restored from answer to currentbuf. */
int use_cb = 0;
#endif
@ -2478,7 +2478,8 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *def,
nanoget_repaint(buf, answer, statusbar_x);
/* Refresh the edit window before getting input. */
/* Refresh the edit window and the statusbar before getting
* input. */
wnoutrefresh(edit);
wrefresh(bottomwin);
@ -2599,7 +2600,7 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *def,
free(currentbuf);
currentbuf = NULL;
use_cb = 1;
/* Itherwise, if currentbuf is NULL and use_cb isn't
/* Otherwise, if currentbuf is NULL and use_cb isn't
* 2, it means that we're scrolling down at the
* bottom of the search history and the current
* answer (if it's not blank) needs to be saved in