diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1998-08-25 22:33:07 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1998-08-25 22:33:07 +0000 |
commit | 986ab5e943db7aaed2aed98f8b74e4c26666fdd8 (patch) | |
tree | 58cfec1114686823dbdbf22cf2ca52f77eb1075d /menu.c | |
parent | 9044dd4d58af4b4d64a6e68b7b76c42d317e7ce5 (diff) |
CVS branch clean-up.
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -23,8 +23,6 @@ #include <string.h> #include <stdlib.h> -#define M_MODEFMT "-- Mutt: %s" - static void print_enriched_string (int attr, unsigned char *s, int do_color) { while (*s) @@ -555,6 +553,8 @@ MUTTMENU *mutt_new_menu (void) { MUTTMENU *p = (MUTTMENU *) safe_calloc (1, sizeof (MUTTMENU)); + p->current = 0; + p->top = 0; p->offset = 1; p->redraw = REDRAW_FULL; p->pagelen = PAGELEN; @@ -574,14 +574,16 @@ void mutt_menuDestroy (MUTTMENU **p) static int menu_search (MUTTMENU *menu, int op) { int r; - int searchDir = (menu->searchDir == M_SEARCH_UP) ? -1 : 1; + int searchDir; regex_t re; char buf[SHORT_STRING]; if (op != OP_SEARCH_NEXT && op != OP_SEARCH_OPPOSITE) { strfcpy (buf, menu->searchBuf ? menu->searchBuf : "", sizeof (buf)); - if (mutt_get_field ("Search for: ", buf, sizeof (buf), M_CLEAR) != 0 || !buf[0]) + if (mutt_get_field ((op == OP_SEARCH) ? "Search for: " : + "Reverse search for: ", + buf, sizeof (buf), M_CLEAR) != 0 || !buf[0]) return (-1); safe_free ((void **) &menu->searchBuf); menu->searchBuf = safe_strdup (buf); @@ -594,11 +596,12 @@ static int menu_search (MUTTMENU *menu, int op) mutt_error ("No search pattern."); return (-1); } - - if (op == OP_SEARCH_OPPOSITE) - searchDir = -searchDir; } + searchDir = (menu->searchDir == M_SEARCH_UP) ? -1 : 1; + if (op == OP_SEARCH_OPPOSITE) + searchDir = -searchDir; + if ((r = REGCOMP (&re, menu->searchBuf, REG_NOSUB | mutt_which_case (menu->searchBuf))) != 0) { regerror (r, &re, buf, sizeof (buf)); |