PagerFlags search_flag;
bool search_back;
const char *banner;
- char *helpstr;
+ const char *helpstr;
char *searchbuf;
struct Line *line_info;
FILE *fp;
{
static char searchbuf[256] = "";
char buf[1024];
- char helpstr[1280];
- char tmphelp[256];
+ struct Buffer *helpstr = NULL;
int ch = 0, rc = -1;
bool first = true;
int searchctx = 0;
rd.extra = extra;
rd.indexlen = C_PagerIndexLines;
rd.indicator = rd.indexlen / 3;
- rd.helpstr = helpstr;
rd.searchbuf = searchbuf;
rd.has_types = (IsEmail(extra) || (flags & MUTT_SHOWCOLOR)) ? MUTT_TYPES : 0; /* main message or rfc822 attachment */
(rd.line_info[i].syntax)[0].last = -1;
}
- mutt_compile_help(helpstr, sizeof(helpstr), MENU_PAGER, PagerHelp);
+ helpstr = mutt_buffer_new();
+ mutt_compile_help(buf, sizeof(buf), MENU_PAGER, PagerHelp);
+ mutt_buffer_strcpy(helpstr, buf);
if (IsEmail(extra))
{
- mutt_str_strfcpy(tmphelp, helpstr, sizeof(tmphelp));
mutt_compile_help(buf, sizeof(buf), MENU_PAGER,
#ifdef USE_NNTP
(Context && (Context->mailbox->magic == MUTT_NNTP)) ?
PagerNewsHelpExtra :
#endif
PagerHelpExtra);
- snprintf(helpstr, sizeof(helpstr), "%s %s", tmphelp, buf);
+ mutt_buffer_addch(helpstr, ' ');
+ mutt_buffer_addstr(helpstr, buf);
}
if (!InHelp)
{
- mutt_str_strfcpy(tmphelp, helpstr, sizeof(tmphelp));
mutt_make_help(buf, sizeof(buf), _("Help"), MENU_PAGER, OP_HELP);
- snprintf(helpstr, sizeof(helpstr), "%s %s", tmphelp, buf);
+ mutt_buffer_addch(helpstr, ' ');
+ mutt_buffer_addstr(helpstr, buf);
}
+ rd.helpstr = mutt_b2s(helpstr);
rd.index_status_window = mutt_mem_calloc(1, sizeof(struct MuttWindow));
rd.index_window = mutt_mem_calloc(1, sizeof(struct MuttWindow));
if (rd.index)
mutt_menu_destroy(&rd.index);
+ mutt_buffer_free(&helpstr);
FREE(&rd.index_status_window);
FREE(&rd.index_window);
FREE(&rd.pager_status_window);