mutt stable branch with some hacks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add menu dialog helper to add rows.

Remove the manual max calculation and dialog row allocation.

Add a NONULL check because the helper uses safe_strdup() to add a row.

+13 -1
+11 -1
menu.c
··· 181 181 { 182 182 if (menu->dialog) 183 183 { 184 - strncpy (s, menu->dialog[i], l); 184 + strncpy (s, NONULL (menu->dialog[i]), l); 185 185 menu->current = -1; /* hide menubar */ 186 186 } 187 187 else ··· 739 739 } 740 740 741 741 FREE (p); /* __FREE_CHECKED__ */ 742 + } 743 + 744 + void mutt_menu_add_dialog_row (MUTTMENU *m, const char *row) 745 + { 746 + if (m->dsize <= m->max) 747 + { 748 + m->dsize += 10; 749 + safe_realloc (&m->dialog, m->dsize * sizeof (char *)); 750 + } 751 + m->dialog[m->max++] = safe_strdup (row); 742 752 } 743 753 744 754 static MUTTMENU *get_current_menu (void)
+2
mutt_menu.h
··· 64 64 * prompt keys override movement keys. 65 65 */ 66 66 char **dialog; /* dialog lines themselves */ 67 + int dsize; /* number of allocated dialog lines */ 67 68 char *prompt; /* prompt for user, similar to mutt_multi_choice */ 68 69 char *keys; /* keys used in the prompt */ 69 70 ··· 124 125 125 126 MUTTMENU *mutt_new_menu (int); 126 127 void mutt_menuDestroy (MUTTMENU **); 128 + void mutt_menu_add_dialog_row (MUTTMENU *, const char *); 127 129 void mutt_push_current_menu (MUTTMENU *); 128 130 void mutt_pop_current_menu (MUTTMENU *); 129 131 void mutt_set_current_menu_redraw (int);