projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rocco Rutte:
[apps/madmutt.git]
/
sidebar.c
diff --git
a/sidebar.c
b/sidebar.c
index
5df3fd8
..
a9b0788
100644
(file)
--- a/
sidebar.c
+++ b/
sidebar.c
@@
-40,10
+40,14
@@
void calc_boundaries (int menu)
if (list_empty(Incoming))
return;
if (list_empty(Incoming))
return;
+ if (CurBuffy < 0 || CurBuffy >= Incoming->length)
+ CurBuffy = 0;
+ if (TopBuffy < 0 || TopBuffy >= Incoming->length)
+ TopBuffy = 0;
/* correct known_lines if it has changed because of a window resize */
/* if (known_lines != LINES)
known_lines = LINES; */
/* correct known_lines if it has changed because of a window resize */
/* if (known_lines != LINES)
known_lines = LINES; */
-
+
lines = LINES - 2 - (menu != MENU_PAGER || option (OPTSTATUSONTOP));
known_lines = lines;
if (option (OPTSIDEBARNEWMAILONLY)) {
lines = LINES - 2 - (menu != MENU_PAGER || option (OPTSTATUSONTOP));
known_lines = lines;
if (option (OPTSIDEBARNEWMAILONLY)) {
@@
-79,7
+83,7
@@
static char *shortened_hierarchy (char *box, int maxlen)
if (last_dot) {
++last_dot;
if (last_dot) {
++last_dot;
- new_box =
safe
_malloc (maxlen + 1);
+ new_box =
mem
_malloc (maxlen + 1);
new_box[0] = box[0];
for (i = 1, j = 1; j < maxlen && i < len; ++i) {
if (strchr (SidebarBoundary, box[i])) {
new_box[0] = box[0];
for (i = 1, j = 1; j < maxlen && i < len; ++i) {
if (strchr (SidebarBoundary, box[i])) {
@@
-189,6
+193,7
@@
int make_sidebar_entry (char* box, int idx, size_t len)
#if USE_IMAP
int l = str_len (ImapHomeNamespace);
#endif
#if USE_IMAP
int l = str_len (ImapHomeNamespace);
#endif
+ int l_m = str_len (Maildir);
if (SidebarWidth > COLS)
SidebarWidth = COLS;
if (SidebarWidth > COLS)
SidebarWidth = COLS;
@@
-211,6
+216,10
@@
int make_sidebar_entry (char* box, int idx, size_t len)
box += l + 1;
else
#endif
box += l + 1;
else
#endif
+ if (l_m > 0 && str_ncmp (box, Maildir, l_m) == 0 &&
+ str_len (box) > l_m)
+ box += l_m + 1;
+ else
box = basename (box);
if (option (OPTSHORTENHIERARCHY) && str_len (box) > len-lencnt-1) {
box = basename (box);
if (option (OPTSHORTENHIERARCHY) && str_len (box) > len-lencnt-1) {
@@
-225,7
+234,7
@@
int make_sidebar_entry (char* box, int idx, size_t len)
addnstr (entry, len);
if (shortened)
addnstr (entry, len);
if (shortened)
-
FREE
(&box);
+
mem_free
(&box);
return (1);
}
return (1);
}