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() do_output()
- Properly allow wrapping when we insert a tab, for consistency. - Properly allow wrapping when we insert a tab, for consistency.
(DLR) (DLR)
- search.c:
get_history_newer()
- Remove redundant check. (DLR)
- utils.c: - utils.c:
num_of_digits() num_of_digits()
- Use a size_t instead of an int, and rename to digits(). (DLR) - Use a size_t instead of an int, and rename to digits(). (DLR)

View File

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

View File

@ -2451,11 +2451,11 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *def,
int last_kbinput = 0; int last_kbinput = 0;
/* This variable is used in the search history code. use_cb == 0 /* This variable is used in the search history code. use_cb == 0
means that we're using the existing history and ignoring * means that we're using the existing history and ignoring
currentbuf. use_cb == 1 means that the entry in answer should be * currentbuf. use_cb == 1 means that the entry in answer should be
moved to currentbuf or restored from currentbuf to answer. * moved to currentbuf or restored from currentbuf to answer.
use_cb == 2 means that the entry in currentbuf should be moved to * use_cb == 2 means that the entry in currentbuf should be moved to
answer or restored from answer to currentbuf. */ * answer or restored from answer to currentbuf. */
int use_cb = 0; int use_cb = 0;
#endif #endif
@ -2478,7 +2478,8 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *def,
nanoget_repaint(buf, answer, statusbar_x); 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); wnoutrefresh(edit);
wrefresh(bottomwin); wrefresh(bottomwin);
@ -2599,7 +2600,7 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *def,
free(currentbuf); free(currentbuf);
currentbuf = NULL; currentbuf = NULL;
use_cb = 1; 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 * 2, it means that we're scrolling down at the
* bottom of the search history and the current * bottom of the search history and the current
* answer (if it's not blank) needs to be saved in * answer (if it's not blank) needs to be saved in