diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1999-09-03 18:16:59 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1999-09-03 18:16:59 +0000 |
commit | c41a1586c453d446d3b38aacb961015621a2caf6 (patch) | |
tree | b3fd446508533c60bca7c9bf70ab25d9b3285465 /browser.c | |
parent | 33bc4a527bbdafd8f34010c4b8e4f332331ba5a6 (diff) |
- If the name of the folder returned by an IMAP server is empty, Mutt
could segfault in the browser window attempting to display it.
- add_folder in browser.c looks like it got corrupted in some CVS
update. A small patch makes things work again for
examine_mailboxes.
(From: Brendan Cully <brendan@kublai.com>)
Diffstat (limited to 'browser.c')
-rw-r--r-- | browser.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -170,7 +170,7 @@ folder_format_str (char *dest, size_t destlen, char op, const char *src, case 'f': #ifdef USE_IMAP if (mx_is_imap (folder->ff->name)) - strfcpy (fn, folder->ff->desc, sizeof (fn)); + strfcpy (fn, NONULL(folder->ff->desc), sizeof (fn)); else #endif strfcpy (fn, folder->ff->name, sizeof(fn)); @@ -302,8 +302,6 @@ folder_format_str (char *dest, size_t destlen, char op, const char *src, static void add_folder (MUTTMENU *m, struct browser_state *state, const char *name, const struct stat *s, int new) { - char buffer[_POSIX_PATH_MAX + SHORT_STRING]; - if (state->entrylen == state->entrymax) { /* need to allocate more space */ @@ -325,7 +323,7 @@ static void add_folder (MUTTMENU *m, struct browser_state *state, (state->entry)[state->entrylen].is_new = new; (state->entry)[state->entrylen].name = safe_strdup (name); - (state->entry)[state->entrylen].desc = safe_strdup (buffer); + (state->entry)[state->entrylen].desc = safe_strdup (name); #ifdef USE_IMAP (state->entry)[state->entrylen].notfolder = 0; #endif |