X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=menu.c;h=e86c4f0a0b46f7fd6d87e38ab0dfc31eb3b64390;hp=0a35299a9c23957885a95d004e780d66eb661187;hb=4dc555afd969ac7aed5c50db80ff9df17ed39e47;hpb=df70e07e24add1869bcc9b7af2277d9d0c09a281 diff --git a/menu.c b/menu.c index 0a35299..e86c4f0 100644 --- a/menu.c +++ b/menu.c @@ -1,19 +1,10 @@ /* + * Copyright notice from original mutt: * Copyright (C) 1996-2000 Michael R. Elkins * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * This file is part of mutt-ng, see http://www.muttng.org/. + * It's licensed under the GNU General Public License, + * please see the file GPL in the top level source directory. */ #if HAVE_CONFIG_H @@ -30,6 +21,10 @@ #include "imap.h" #endif +#include "lib/mem.h" +#include "lib/intl.h" +#include "lib/str.h" + #include #include @@ -41,7 +36,7 @@ static void print_enriched_string (int attr, unsigned char *s, int do_color) { wchar_t wc; size_t k; - size_t n = mutt_strlen ((char *) s); + size_t n = safe_strlen ((char *) s); mbstate_t mbstate; memset (&mbstate, 0, sizeof (mbstate)); @@ -160,7 +155,7 @@ void menu_pad_string (char *s, size_t n) cols = COLS - shift - SidebarWidth; else cols = COLS - shift; - mutt_format_string (tmpbuf, n, cols, cols, 0, ' ', s, strlen (s), 1); + mutt_format_string (tmpbuf, n, cols, cols, 0, ' ', s, safe_strlen (s), 1); tmpbuf[n - 1] = 0; snprintf (s, n, "%s", tmpbuf); /* overkill */ FREE (&tmpbuf); @@ -208,7 +203,7 @@ void menu_redraw_index (MUTTMENU * menu) char buf[STRING]; int i; - draw_sidebar (1); + sidebar_draw (1); for (i = menu->top; i < menu->top + menu->pagelen; i++) { if (i < menu->max) { menu_make_entry (buf, sizeof (buf), menu, i); @@ -702,7 +697,7 @@ static int menu_search (MUTTMENU * menu, int op) _("Reverse search for: "), buf, sizeof (buf), M_CLEAR) != 0 || !buf[0]) return (-1); - mutt_str_replace (&menu->searchBuf, buf); + str_replace (&menu->searchBuf, buf); menu->searchDir = (op == OP_SEARCH) ? M_SEARCH_DOWN : M_SEARCH_UP; } else {