Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated for 1.5.22 from FreeBSD Ports

  • Loading branch information...
commit 7ba0d8db829fe54c4940a7471ac2ebc2283ecb15 1 parent 53bd5b7
@nedos authored
Showing with 365 additions and 275 deletions.
  1. +365 −275 mutt-sidebar.patch
View
640 mutt-sidebar.patch
@@ -1,49 +1,53 @@
+commit c47dfe4bdc5c239d723d076f216a309a8b3c8f0f
+Author: Dmitry Nedospasov <dmitry@nedos.net>
+Date: Sun Oct 27 12:45:38 2013 +0200
+
+ fixed
+
diff --git a/Makefile.am b/Makefile.am
-index 0905a68..466f4de 100644
+index 8166b1b..5565c74 100644
--- a/Makefile.am
+++ b/Makefile.am
-@@ -33,7 +33,8 @@ mutt_SOURCES = \
+@@ -33,7 +33,7 @@ mutt_SOURCES = \
score.c send.c sendlib.c signal.c sort.c \
status.c system.c thread.c charset.c history.c lib.c \
muttlib.c editmsg.c mbyte.c \
- url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c
-+ url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c \
-+ sidebar.c
++ url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c sidebar.c
nodist_mutt_SOURCES = $(BUILT_SOURCES)
diff --git a/Makefile.in b/Makefile.in
-index e766c66..6e0070a 100644
+index 57a2176..bf34d09 100644
--- a/Makefile.in
+++ b/Makefile.in
-@@ -85,7 +85,8 @@ am_mutt_OBJECTS = addrbook.$(OBJEXT) alias.$(OBJEXT) attach.$(OBJEXT) \
+@@ -129,7 +129,7 @@ am_mutt_OBJECTS = addrbook.$(OBJEXT) alias.$(OBJEXT) attach.$(OBJEXT) \
system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \
history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \
editmsg.$(OBJEXT) mbyte.$(OBJEXT) url.$(OBJEXT) \
- ascii.$(OBJEXT) crypt-mod.$(OBJEXT) safe_asprintf.$(OBJEXT)
-+ ascii.$(OBJEXT) crypt-mod.$(OBJEXT) safe_asprintf.$(OBJEXT) \
-+ sidebar.$(OBJEXT)
++ ascii.$(OBJEXT) crypt-mod.$(OBJEXT) safe_asprintf.$(OBJEXT) sidebar.$(OBJEXT)
am__objects_1 =
- am__objects_2 = patchlist.$(OBJEXT) $(am__objects_1)
- nodist_mutt_OBJECTS = $(am__objects_2)
-@@ -359,7 +360,8 @@ mutt_SOURCES = \
+ am__objects_2 = patchlist.$(OBJEXT) conststrings.$(OBJEXT) \
+ $(am__objects_1)
+@@ -468,7 +468,7 @@ mutt_SOURCES = \
score.c send.c sendlib.c signal.c sort.c \
status.c system.c thread.c charset.c history.c lib.c \
muttlib.c editmsg.c mbyte.c \
- url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c
-+ url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c \
-+ sidebar.c
++ url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c sidebar.c
nodist_mutt_SOURCES = $(BUILT_SOURCES)
mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \
-@@ -671,6 +673,7 @@ distclean-compile:
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/send.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendlib.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@
-+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sidebar.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smime.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp.Po@am__quote@
+@@ -500,7 +500,7 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO UPDATING \
+ README.SSL smime.h group.h \
+ muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
+ ChangeLog mkchangelog.sh mutt_idna.h \
+- snprintf.c regex.c crypt-gpgme.h hcachever.sh.in \
++ snprintf.c regex.c crypt-gpgme.h sidebar.h hcachever.sh.in \
+ txt2c.c txt2c.sh version.sh check_sec.sh
+
+ EXTRA_SCRIPTS = smime_keys
diff --git a/OPS b/OPS
index 8414a8b..ef14453 100644
--- a/OPS
@@ -57,146 +61,194 @@ index 8414a8b..ef14453 100644
+OP_SIDEBAR_NEXT "go down to next mailbox"
+OP_SIDEBAR_PREV "go to previous mailbox"
+OP_SIDEBAR_OPEN "open hilighted mailbox"
+diff --git a/PATCHES b/PATCHES
+index e69de29..2d08057 100644
+--- a/PATCHES
++++ b/PATCHES
+@@ -0,0 +1 @@
++patch-1.5.22.sidebar.gentoo-openbsd
diff --git a/buffy.c b/buffy.c
-index fd54dd2..90bf3e4 100644
+index e5a0f79..225104d 100644
--- a/buffy.c
+++ b/buffy.c
-@@ -312,6 +312,10 @@ static int buffy_maildir_hasnew (BUFFY* mailbox)
- return 0;
+@@ -161,6 +161,49 @@ void mutt_buffy_cleanup (const char *buf, struct stat *st)
}
+ }
+
++static int buffy_compare_name(const void *a, const void *b) {
++ const BUFFY *b1 = * (BUFFY * const *) a;
++ const BUFFY *b2 = * (BUFFY * const *) b;
++
++ return mutt_strcoll(b1->path, b2->path);
++}
++
++static BUFFY *buffy_sort(BUFFY *b)
++{
++ BUFFY *tmp = b;
++ int buffycount = 0;
++ BUFFY **ary;
++ int i;
++
++ if (!option(OPTSIDEBARSORT))
++ return b;
++
++ for (; tmp != NULL; tmp = tmp->next)
++ buffycount++;
++
++ ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary));
++
++ tmp = b;
++ for (i = 0; tmp != NULL; tmp = tmp->next, i++) {
++ ary[i] = tmp;
++ }
++
++ qsort(ary, buffycount, sizeof(*ary), buffy_compare_name);
++
++ for (i = 0; i < buffycount - 1; i++) {
++ ary[i]->next = ary[i+1];
++ }
++ ary[buffycount - 1]->next = NULL;
++ for (i = 1; i < buffycount; i++) {
++ ary[i]->prev = ary[i-1];
++ }
++ ary[0]->prev = NULL;
++
++ tmp = ary[0];
++ free(ary);
++ return tmp;
++}
++
+ BUFFY *mutt_find_mailbox (const char *path)
+ {
+ BUFFY *tmp = NULL;
+@@ -282,6 +325,7 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *e
+ else
+ (*tmp)->size = 0;
+ }
++ Incoming = buffy_sort(Incoming);
+ return 0;
+ }
+
+@@ -340,6 +384,68 @@ static int buffy_maildir_hasnew (BUFFY* mailbox)
+ return rc;
+ }
++/* update message counts for the sidebar */
++void buffy_maildir_update (BUFFY* mailbox)
++{
++ char path[_POSIX_PATH_MAX];
++ DIR *dirp;
++ struct dirent *de;
++ char *p;
++
+ mailbox->msgcount = 0;
+ mailbox->msg_unread = 0;
+ mailbox->msg_flagged = 0;
+
- while ((de = readdir (dirp)) != NULL)
- {
- if (*de->d_name == '.')
-@@ -329,7 +333,9 @@ static int buffy_maildir_hasnew (BUFFY* mailbox)
- continue;
- }
- /* one new and undeleted message is enough */
-- mailbox->new = 1;
-+ mailbox->has_new = mailbox->new = 1;
++ snprintf (path, sizeof (path), "%s/new", mailbox->path);
++
++ if ((dirp = opendir (path)) == NULL)
++ {
++ mailbox->magic = 0;
++ return;
++ }
++
++ while ((de = readdir (dirp)) != NULL)
++ {
++ if (*de->d_name == '.')
++ continue;
++
++ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) {
++ mailbox->new = 1;
+ mailbox->msgcount++;
+ mailbox->msg_unread++;
- rc = 1;
- break;
- }
-@@ -337,6 +343,34 @@ static int buffy_maildir_hasnew (BUFFY* mailbox)
-
- closedir (dirp);
-
-+ /*
-+ * count read messages (for folderlist (sidebar) we also need to count
-+ * messages in cur so that we the total number of messages
-+ */
++ }
++ }
++
++ closedir (dirp);
+ snprintf (path, sizeof (path), "%s/cur", mailbox->path);
++
+ if ((dirp = opendir (path)) == NULL)
-+ {
++ {
+ mailbox->magic = 0;
-+ }
++ return;
++ }
++
+ while ((de = readdir (dirp)) != NULL)
+ {
-+ char *p;
-+ if (*de->d_name != '.') {
++ if (*de->d_name == '.')
++ continue;
++
++ if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) {
++ mailbox->msgcount++;
+ if ((p = strstr (de->d_name, ":2,"))) {
+ if (!strchr (p + 3, 'T')) {
-+ mailbox->msgcount++;
-+ if ( !strchr (p + 3, 'S'))
++ if (!strchr (p + 3, 'S'))
+ mailbox->msg_unread++;
+ if (strchr(p + 3, 'F'))
+ mailbox->msg_flagged++;
+ }
-+ } else
-+ mailbox->msgcount++;
++ }
+ }
+ }
+
+ closedir (dirp);
++}
+
+ /* returns 1 if mailbox has new mail */
+ static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
+ {
+@@ -371,6 +477,20 @@ static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
return rc;
}
-@@ -345,14 +379,33 @@ static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
- {
- int rc = 0;
- int statcheck;
-+ CONTEXT *ctx;
-
- if (option (OPTCHECKMBOXSIZE))
- statcheck = sb->st_size > mailbox->size;
- else
- statcheck = sb->st_mtime > sb->st_atime
- || (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime);
-- if (statcheck)
-+ if (statcheck || mailbox->msgcount == 0)
- {
-+ BUFFY b = *mailbox;
-+ int msgcount = 0;
-+ int msg_unread = 0;
-+ /* parse the mailbox, to see how much mail there is */
-+ ctx = mx_open_mailbox( mailbox->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL);
-+ if(ctx)
-+ {
-+ msgcount = ctx->msgcount;
-+ msg_unread = ctx->unread;
-+ mx_close_mailbox(ctx, 0);
-+ }
-+ *mailbox = b;
-+ mailbox->msgcount = msgcount;
-+ mailbox->msg_unread = msg_unread;
-+ if(statcheck)
-+ {
-+ mailbox->has_new = mailbox->new = 1;
-+ }
- if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited)
- {
- rc = 1;
-@@ -374,9 +427,11 @@ static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
- int mutt_buffy_check (int force)
- {
- BUFFY *tmp;
-+ struct dirent *de, *dp;
- struct stat sb;
- struct stat contex_sb;
- time_t t;
-+ CONTEXT *ctx;
-
- sb.st_size=0;
- contex_sb.st_dev=0;
-@@ -456,6 +511,20 @@ int mutt_buffy_check (int force)
- case M_MH:
- if ((tmp->new = mh_buffy (tmp->path)) > 0)
- BuffyCount++;
++/* update message counts for the sidebar */
++void buffy_mbox_update (BUFFY* mailbox)
++{
++ CONTEXT *ctx = NULL;
+
-+ if ((dp = opendir (tmp->path)) == NULL)
-+ break;
-+ tmp->msgcount = 0;
-+ while ((de = readdir (dp)))
++ ctx = mx_open_mailbox(mailbox->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL);
++ if(ctx)
+ {
-+ if (mh_valid_message (de->d_name))
-+ {
-+ tmp->msgcount++;
-+ tmp->has_new = tmp->new = 1;
-+ }
++ mailbox->msgcount = ctx->msgcount;
++ mailbox->msg_unread = ctx->unread;
++ mx_close_mailbox(ctx, 0);
+ }
-+ closedir (dp);
++}
+
+ int mutt_buffy_check (int force)
+ {
+ BUFFY *tmp;
+@@ -444,16 +564,19 @@ int mutt_buffy_check (int force)
+ {
+ case M_MBOX:
+ case M_MMDF:
++ buffy_mbox_update (tmp);
+ if (buffy_mbox_hasnew (tmp, &sb) > 0)
+ BuffyCount++;
break;
- }
- }
+
+ case M_MAILDIR:
++ buffy_maildir_update (tmp);
+ if (buffy_maildir_hasnew (tmp) > 0)
+ BuffyCount++;
+ break;
+
+ case M_MH:
++ mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged);
+ mh_buffy(tmp);
+ if (tmp->new)
+ BuffyCount++;
diff --git a/buffy.h b/buffy.h
-index 2e5e048..d9491f2 100644
+index f9fc55a..672d178 100644
--- a/buffy.h
+++ b/buffy.h
-@@ -25,7 +25,12 @@ typedef struct buffy_t
+@@ -25,7 +25,11 @@ typedef struct buffy_t
char path[_POSIX_PATH_MAX];
off_t size;
struct buffy_t *next;
+ struct buffy_t *prev;
short new; /* mailbox has new mail */
-+ short has_new; /* set it new if new and not read */
+ int msgcount; /* total number of messages */
+ int msg_unread; /* number of unread messages */
+ int msg_flagged; /* number of flagged messages */
@@ -204,10 +256,10 @@ index 2e5e048..d9491f2 100644
short magic; /* mailbox type */
short newly_created; /* mbox or mmdf just popped into existence */
diff --git a/color.c b/color.c
-index b39957f..bb6cbb4 100644
+index ef97ca9..2112132 100644
--- a/color.c
+++ b/color.c
-@@ -93,6 +93,8 @@ static struct mapping_t Fields[] =
+@@ -93,6 +93,8 @@ static const struct mapping_t Fields[] =
{ "bold", MT_COLOR_BOLD },
{ "underline", MT_COLOR_UNDERLINE },
{ "index", MT_COLOR_INDEX },
@@ -217,7 +269,7 @@ index b39957f..bb6cbb4 100644
};
diff --git a/compose.c b/compose.c
-index c251d41..8469a7a 100644
+index 9cfa2d4..5a14d70 100644
--- a/compose.c
+++ b/compose.c
@@ -72,7 +72,7 @@ enum
@@ -227,18 +279,18 @@ index c251d41..8469a7a 100644
-#define W (COLS - HDR_XOFFSET)
+#define W (COLS - HDR_XOFFSET - SidebarWidth)
- static char *Prompts[] =
+ static const char * const Prompts[] =
{
-@@ -112,7 +112,7 @@ static void redraw_crypt_lines (HEADER *msg)
- {
- int off = 0;
+@@ -110,7 +110,7 @@ static void snd_entry (char *b, size_t blen, MUTTMENU *menu, int num)
+ static void redraw_crypt_lines (HEADER *msg)
+ {
- mvaddstr (HDR_CRYPT, 0, "Security: ");
-+ mvaddstr (HDR_CRYPT, SidebarWidth, "Security: ");
++ mvaddstr (HDR_CRYPT, SidebarWidth, "Security: ");
if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0)
{
-@@ -144,7 +144,7 @@ static void redraw_crypt_lines (HEADER *msg)
+@@ -142,7 +142,7 @@ static void redraw_crypt_lines (HEADER *msg)
}
clrtoeol ();
@@ -247,16 +299,16 @@ index c251d41..8469a7a 100644
clrtoeol ();
if ((WithCrypto & APPLICATION_PGP)
-@@ -161,7 +161,7 @@ static void redraw_crypt_lines (HEADER *msg)
+@@ -159,7 +159,7 @@ static void redraw_crypt_lines (HEADER *msg)
&& (msg->security & ENCRYPT)
&& SmimeCryptAlg
&& *SmimeCryptAlg) {
- mvprintw (HDR_CRYPTINFO, 40, "%s%s", _("Encrypt with: "),
+ mvprintw (HDR_CRYPTINFO, SidebarWidth + 40, "%s%s", _("Encrypt with: "),
NONULL(SmimeCryptAlg));
- off = 20;
}
-@@ -175,7 +175,7 @@ static void redraw_mix_line (LIST *chain)
+ }
+@@ -172,7 +172,7 @@ static void redraw_mix_line (LIST *chain)
int c;
char *t;
@@ -265,7 +317,7 @@ index c251d41..8469a7a 100644
if (!chain)
{
-@@ -190,7 +190,7 @@ static void redraw_mix_line (LIST *chain)
+@@ -187,7 +187,7 @@ static void redraw_mix_line (LIST *chain)
if (t && t[0] == '0' && t[1] == '\0')
t = "<random>";
@@ -274,7 +326,7 @@ index c251d41..8469a7a 100644
break;
addstr (NONULL(t));
-@@ -242,7 +242,7 @@ static void draw_envelope_addr (int line, ADDRESS *addr)
+@@ -239,7 +239,7 @@ static void draw_envelope_addr (int line, ADDRESS *addr)
buf[0] = 0;
rfc822_write_address (buf, sizeof (buf), addr, 1);
@@ -283,7 +335,7 @@ index c251d41..8469a7a 100644
mutt_paddstr (W, buf);
}
-@@ -252,10 +252,10 @@ static void draw_envelope (HEADER *msg, char *fcc)
+@@ -249,10 +249,10 @@ static void draw_envelope (HEADER *msg, char *fcc)
draw_envelope_addr (HDR_TO, msg->env->to);
draw_envelope_addr (HDR_CC, msg->env->cc);
draw_envelope_addr (HDR_BCC, msg->env->bcc);
@@ -296,16 +348,16 @@ index c251d41..8469a7a 100644
mutt_paddstr (W, fcc);
if (WithCrypto)
-@@ -266,7 +266,7 @@ static void draw_envelope (HEADER *msg, char *fcc)
+@@ -263,7 +263,7 @@ static void draw_envelope (HEADER *msg, char *fcc)
#endif
SETCOLOR (MT_COLOR_STATUS);
- mvaddstr (HDR_ATTACH - 1, 0, _("-- Attachments"));
+ mvaddstr (HDR_ATTACH - 1, SidebarWidth, _("-- Attachments"));
- BKGDSET (MT_COLOR_STATUS);
clrtoeol ();
-@@ -304,7 +304,7 @@ static int edit_address_list (int line, ADDRESS **addr)
+ NORMAL_COLOR;
+@@ -299,7 +299,7 @@ static int edit_address_list (int line, ADDRESS **addr)
/* redraw the expanded list so the user can see the result */
buf[0] = 0;
rfc822_write_address (buf, sizeof (buf), *addr, 1);
@@ -314,16 +366,16 @@ index c251d41..8469a7a 100644
mutt_paddstr (W, buf);
return 0;
-@@ -549,7 +549,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
+@@ -544,7 +544,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0)
{
mutt_str_replace (&msg->env->subject, buf);
- move (HDR_SUBJECT, HDR_XOFFSET);
+ move (HDR_SUBJECT, HDR_XOFFSET + SidebarWidth);
- clrtoeol ();
if (msg->env->subject)
mutt_paddstr (W, msg->env->subject);
-@@ -566,7 +566,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
+ else
+@@ -562,7 +562,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
{
strfcpy (fcc, buf, fcclen);
mutt_pretty_mailbox (fcc, fcclen);
@@ -333,7 +385,7 @@ index c251d41..8469a7a 100644
fccSet = 1;
}
diff --git a/curs_main.c b/curs_main.c
-index dd2ac39..21013b9 100644
+index aa4b044..5140878 100644
--- a/curs_main.c
+++ b/curs_main.c
@@ -26,7 +26,9 @@
@@ -369,21 +421,20 @@ index dd2ac39..21013b9 100644
mutt_show_error ();
}
-@@ -554,10 +561,13 @@ int mutt_index_menu (void)
+@@ -554,9 +561,12 @@ int mutt_index_menu (void)
if (menu->redraw & REDRAW_STATUS)
{
-+ DrawFullLine = 1;
++ DrawFullLine = 1;
menu_status_line (buf, sizeof (buf), menu, NONULL (Status));
-+ DrawFullLine = 0;
- CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES-2);
++ DrawFullLine = 0;
+ move (option (OPTSTATUSONTOP) ? 0 : LINES-2, 0);
SETCOLOR (MT_COLOR_STATUS);
- BKGDSET (MT_COLOR_STATUS);
-+ set_buffystats(Context);
++ set_buffystats(Context);
mutt_paddstr (COLS, buf);
- SETCOLOR (MT_COLOR_NORMAL);
- BKGDSET (MT_COLOR_NORMAL);
-@@ -571,7 +581,7 @@ int mutt_index_menu (void)
+ NORMAL_COLOR;
+ menu->redraw &= ~REDRAW_STATUS;
+@@ -569,7 +579,7 @@ int mutt_index_menu (void)
menu->oldcurrent = -1;
if (option (OPTARROWCURSOR))
@@ -392,7 +443,7 @@ index dd2ac39..21013b9 100644
else if (option (OPTBRAILLEFRIENDLY))
move (menu->current - menu->top + menu->offset, 0);
else
-@@ -1069,6 +1079,7 @@ int mutt_index_menu (void)
+@@ -1070,6 +1080,7 @@ int mutt_index_menu (void)
menu->redraw = REDRAW_FULL;
break;
@@ -400,7 +451,7 @@ index dd2ac39..21013b9 100644
case OP_MAIN_CHANGE_FOLDER:
case OP_MAIN_NEXT_UNREAD_MAILBOX:
-@@ -1100,7 +1111,11 @@ int mutt_index_menu (void)
+@@ -1101,7 +1112,11 @@ int mutt_index_menu (void)
{
mutt_buffy (buf, sizeof (buf));
@@ -408,12 +459,12 @@ index dd2ac39..21013b9 100644
+ if ( op == OP_SIDEBAR_OPEN ) {
+ if(!CurBuffy)
+ break;
-+ strncpy( buf, CurBuffy->path, sizeof(buf) );
++ strncpy( buf, CurBuffy->path, sizeof(buf) );
+ } else if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
{
if (menu->menu == MENU_PAGER)
{
-@@ -1118,6 +1133,7 @@ int mutt_index_menu (void)
+@@ -1119,6 +1134,7 @@ int mutt_index_menu (void)
}
mutt_expand_path (buf, sizeof (buf));
@@ -421,7 +472,7 @@ index dd2ac39..21013b9 100644
if (mx_get_magic (buf) <= 0)
{
mutt_error (_("%s is not a mailbox."), buf);
-@@ -2208,6 +2224,12 @@ int mutt_index_menu (void)
+@@ -2209,6 +2225,12 @@ int mutt_index_menu (void)
mutt_what_key();
break;
@@ -435,7 +486,7 @@ index dd2ac39..21013b9 100644
if (menu->menu == MENU_MAIN)
km_error_key (MENU_MAIN);
diff --git a/doc/Muttrc b/doc/Muttrc
-index 4ccb643..d6ff579 100644
+index f34fdc7..230b6d0 100644
--- a/doc/Muttrc
+++ b/doc/Muttrc
@@ -657,6 +657,26 @@ attachments -I message/external-body
@@ -447,21 +498,21 @@ index 4ccb643..d6ff579 100644
+# Name: sidebar_visible
+# Type: boolean
+# Default: no
-+#
-+#
++#
++#
+# This specifies whether or not to show sidebar (left-side list of folders).
-+#
-+#
++#
++#
+# set sidebar_width=0
+#
+# Name: sidebar_width
+# Type: number
+# Default: 0
-+#
-+#
++#
++#
+# The width of the sidebar.
-+#
-+#
++#
++#
# set crypt_autosign=no
#
# Name: crypt_autosign
@@ -489,10 +540,10 @@ index f0f3d81..d675000 100644
void mutt_tag_set_flag (int flag, int bf)
diff --git a/functions.h b/functions.h
-index e8beacb..7e64952 100644
+index 7a1c5a9..39dc50b 100644
--- a/functions.h
+++ b/functions.h
-@@ -169,6 +169,11 @@ struct binding_t OpMain[] = { /* map: index */
+@@ -169,6 +169,11 @@ const struct binding_t OpMain[] = { /* map: index */
{ "decrypt-save", OP_DECRYPT_SAVE, NULL },
@@ -504,7 +555,7 @@ index e8beacb..7e64952 100644
{ NULL, 0, NULL }
};
-@@ -272,6 +277,11 @@ struct binding_t OpPager[] = { /* map: pager */
+@@ -272,6 +277,11 @@ const struct binding_t OpPager[] = { /* map: pager */
{ "what-key", OP_WHAT_KEY, NULL },
@@ -517,7 +568,7 @@ index e8beacb..7e64952 100644
};
diff --git a/globals.h b/globals.h
-index 62d831d..ced77ce 100644
+index 6fefe5b..77cdc5c 100644
--- a/globals.h
+++ b/globals.h
@@ -117,6 +117,7 @@ WHERE short SearchContext;
@@ -528,7 +579,7 @@ index 62d831d..ced77ce 100644
WHERE char *Signature;
WHERE char *SimpleSearch;
#if USE_SMTP
-@@ -207,6 +208,9 @@ WHERE short ScoreThresholdDelete;
+@@ -208,6 +209,9 @@ WHERE short ScoreThresholdDelete;
WHERE short ScoreThresholdRead;
WHERE short ScoreThresholdFlag;
@@ -539,10 +590,10 @@ index 62d831d..ced77ce 100644
WHERE short ImapKeepalive;
WHERE short ImapPipelineDepth;
diff --git a/imap/command.c b/imap/command.c
-index 3330d98..93ee744 100644
+index 32f8417..d68e3ab 100644
--- a/imap/command.c
+++ b/imap/command.c
-@@ -1011,6 +1011,13 @@ static void cmd_parse_status (IMAP_DATA* idata, char* s)
+@@ -1012,6 +1012,13 @@ static void cmd_parse_status (IMAP_DATA* idata, char* s)
opened */
status->uidnext = oldun;
@@ -557,10 +608,10 @@ index 3330d98..93ee744 100644
return;
}
diff --git a/imap/imap.c b/imap/imap.c
-index f08b4ea..89c9823 100644
+index 93dc06a..52177fb 100644
--- a/imap/imap.c
+++ b/imap/imap.c
-@@ -1521,7 +1521,7 @@ int imap_buffy_check (int force)
+@@ -1514,7 +1514,7 @@ int imap_buffy_check (int force)
imap_munge_mbox_name (munged, sizeof (munged), name);
snprintf (command, sizeof (command),
@@ -570,17 +621,17 @@ index f08b4ea..89c9823 100644
if (imap_exec (idata, command, IMAP_CMD_QUEUE) < 0)
{
diff --git a/init.h b/init.h
-index ab262f1..3ade5ee 100644
+index b5b2886..6e08350 100644
--- a/init.h
+++ b/init.h
-@@ -1953,6 +1953,22 @@ struct option_t MuttVars[] = {
+@@ -1966,6 +1966,27 @@ struct option_t MuttVars[] = {
** not used.
** (PGP only)
*/
+ {"sidebar_delim", DT_STR, R_BOTH, UL &SidebarDelim, "|"},
+ /*
+ ** .pp
-+ ** This specifies the delimiter between the sidebar (if visible) and
++ ** This specifies the delimiter between the sidebar (if visible) and
+ ** other screens.
+ */
+ { "sidebar_visible", DT_BOOL, R_BOTH, OPTSIDEBAR, 0 },
@@ -588,6 +639,11 @@ index ab262f1..3ade5ee 100644
+ ** .pp
+ ** This specifies whether or not to show sidebar (left-side list of folders).
+ */
++ { "sidebar_sort", DT_BOOL, R_BOTH, OPTSIDEBARSORT, 0 },
++ /*
++ ** .pp
++ ** This specifies whether or not to sort the sidebar alphabetically.
++ */
+ { "sidebar_width", DT_NUM, R_BOTH, UL &SidebarWidth, 0 },
+ /*
+ ** .pp
@@ -609,7 +665,7 @@ index 91e5dc7..b652628 100644
/* mx_open_new_message() */
#define M_ADD_FROM 1 /* add a From_ line */
diff --git a/mbox.c b/mbox.c
-index afd1be4..0dc4580 100644
+index 253061a..cd51e64 100644
--- a/mbox.c
+++ b/mbox.c
@@ -100,6 +100,7 @@ int mmdf_parse_mailbox (CONTEXT *ctx)
@@ -629,7 +685,7 @@ index afd1be4..0dc4580 100644
#ifdef NFS_ATTRIBUTE_HACK
if (sb.st_mtime > sb.st_atime)
diff --git a/menu.c b/menu.c
-index ff830f3..6a1f5db 100644
+index e03dd33..7e8c8e3 100644
--- a/menu.c
+++ b/menu.c
@@ -24,6 +24,7 @@
@@ -638,9 +694,9 @@ index ff830f3..6a1f5db 100644
#include "mbyte.h"
+#include "sidebar.h"
- #include <string.h>
- #include <stdlib.h>
-@@ -156,7 +157,7 @@ static void menu_pad_string (char *s, size_t n)
+ extern size_t UngetCount;
+
+@@ -186,7 +187,7 @@ static void menu_pad_string (char *s, size_t n)
{
char *scratch = safe_strdup (s);
int shift = option (OPTARROWCURSOR) ? 3 : 0;
@@ -649,84 +705,76 @@ index ff830f3..6a1f5db 100644
mutt_format_string (s, n, cols, cols, FMT_LEFT, ' ', scratch, mutt_strlen (scratch), 1);
s[n - 1] = 0;
-@@ -207,6 +208,7 @@ void menu_redraw_index (MUTTMENU *menu)
- char buf[LONG_STRING];
- int i;
+@@ -239,6 +240,7 @@ void menu_redraw_index (MUTTMENU *menu)
+ int do_color;
+ int attr;
+ draw_sidebar(1);
for (i = menu->top; i < menu->top + menu->pagelen; i++)
{
if (i < menu->max)
-@@ -217,7 +219,7 @@ void menu_redraw_index (MUTTMENU *menu)
- if (option (OPTARROWCURSOR))
- {
- attrset (menu->color (i));
-- CLEARLINE (i - menu->top + menu->offset);
-+ CLEARLINE_WIN (i - menu->top + menu->offset);
+@@ -249,7 +251,7 @@ void menu_redraw_index (MUTTMENU *menu)
+ menu_pad_string (buf, sizeof (buf));
- if (i == menu->current)
- {
-@@ -246,14 +248,14 @@ void menu_redraw_index (MUTTMENU *menu)
- BKGDSET (MT_COLOR_INDICATOR);
- }
+ ATTRSET(attr);
+- move(i - menu->top + menu->offset, 0);
++ move(i - menu->top + menu->offset, SidebarWidth);
+ do_color = 1;
-- CLEARLINE (i - menu->top + menu->offset);
-+ CLEARLINE_WIN (i - menu->top + menu->offset);
- print_enriched_string (menu->color(i), (unsigned char *) buf, i != menu->current);
- SETCOLOR (MT_COLOR_NORMAL);
- BKGDSET (MT_COLOR_NORMAL);
- }
- }
+ if (i == menu->current)
+@@ -272,7 +274,7 @@ void menu_redraw_index (MUTTMENU *menu)
else
-- CLEARLINE (i - menu->top + menu->offset);
-+ CLEARLINE_WIN (i - menu->top + menu->offset);
+ {
+ NORMAL_COLOR;
+- CLEARLINE(i - menu->top + menu->offset);
++ CLEARLINE_WIN(i - menu->top + menu->offset);
+ }
}
- menu->redraw = 0;
- }
-@@ -268,7 +270,7 @@ void menu_redraw_motion (MUTTMENU *menu)
+ NORMAL_COLOR;
+@@ -289,7 +291,7 @@ void menu_redraw_motion (MUTTMENU *menu)
return;
}
- move (menu->oldcurrent + menu->offset - menu->top, 0);
+ move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth);
- SETCOLOR (MT_COLOR_NORMAL);
- BKGDSET (MT_COLOR_NORMAL);
+ ATTRSET(menu->color (menu->oldcurrent));
-@@ -283,13 +285,13 @@ void menu_redraw_motion (MUTTMENU *menu)
- clrtoeol ();
+ if (option (OPTARROWCURSOR))
+@@ -301,13 +303,13 @@ void menu_redraw_motion (MUTTMENU *menu)
+ {
menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
menu_pad_string (buf, sizeof (buf));
- move (menu->oldcurrent + menu->offset - menu->top, 3);
+ move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth + 3);
print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1);
- SETCOLOR (MT_COLOR_NORMAL);
}
/* now draw it in the new location */
-- move (menu->current + menu->offset - menu->top, 0);
-+ move (menu->current + menu->offset - menu->top, SidebarWidth);
- attrset (menu->color (menu->current));
- ADDCOLOR (MT_COLOR_INDICATOR);
- addstr ("->");
-@@ -310,7 +312,7 @@ void menu_redraw_motion (MUTTMENU *menu)
- attrset (menu->color (menu->current));
- ADDCOLOR (MT_COLOR_INDICATOR);
- BKGDSET (MT_COLOR_INDICATOR);
-- CLEARLINE (menu->current - menu->top + menu->offset);
-+ CLEARLINE_WIN (menu->current - menu->top + menu->offset);
+ SETCOLOR(MT_COLOR_INDICATOR);
+- mvaddstr(menu->current + menu->offset - menu->top, 0, "->");
++ mvaddstr(menu->current + menu->offset - menu->top, SidebarWidth, "->");
+ }
+ else
+ {
+@@ -320,7 +322,7 @@ void menu_redraw_motion (MUTTMENU *menu)
+ menu_make_entry (buf, sizeof (buf), menu, menu->current);
+ menu_pad_string (buf, sizeof (buf));
+ SETCOLOR(MT_COLOR_INDICATOR);
+- move(menu->current - menu->top + menu->offset, 0);
++ move(menu->current - menu->top + menu->offset, SidebarWidth);
print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0);
- SETCOLOR (MT_COLOR_NORMAL);
- BKGDSET (MT_COLOR_NORMAL);
-@@ -322,7 +324,7 @@ void menu_redraw_current (MUTTMENU *menu)
- {
+ }
+ menu->redraw &= REDRAW_STATUS;
+@@ -332,7 +334,7 @@ void menu_redraw_current (MUTTMENU *menu)
char buf[LONG_STRING];
+ int attr = menu->color (menu->current);
- move (menu->current + menu->offset - menu->top, 0);
+ move (menu->current + menu->offset - menu->top, SidebarWidth);
menu_make_entry (buf, sizeof (buf), menu, menu->current);
menu_pad_string (buf, sizeof (buf));
-@@ -875,7 +877,7 @@ int mutt_menuLoop (MUTTMENU *menu)
+@@ -872,7 +874,7 @@ int mutt_menuLoop (MUTTMENU *menu)
if (option (OPTARROWCURSOR))
@@ -735,19 +783,53 @@ index ff830f3..6a1f5db 100644
else if (option (OPTBRAILLEFRIENDLY))
move (menu->current - menu->top + menu->offset, 0);
else
+diff --git a/mh.c b/mh.c
+index 21e6491..48a16fb 100644
+--- a/mh.c
++++ b/mh.c
+@@ -295,6 +295,28 @@ void mh_buffy(BUFFY *b)
+ mhs_free_sequences (&mhs);
+ }
+
++void mh_buffy_update (const char *path, int *msgcount, int *msg_unread, int *msg_flagged)
++{
++ int i;
++ struct mh_sequences mhs;
++ memset (&mhs, 0, sizeof (mhs));
++
++ if (mh_read_sequences (&mhs, path) < 0)
++ return;
++
++ msgcount = 0;
++ msg_unread = 0;
++ msg_flagged = 0;
++ for (i = 0; i <= mhs.max; i++)
++ msgcount++;
++ if (mhs_check (&mhs, i) & MH_SEQ_UNSEEN) {
++ msg_unread++;
++ }
++ if (mhs_check (&mhs, i) & MH_SEQ_FLAGGED)
++ msg_flagged++;
++ mhs_free_sequences (&mhs);
++}
++
+ static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt)
+ {
+ int fd;
diff --git a/mutt.h b/mutt.h
-index 578d111..25822e5 100644
+index 06e3c8c..11ad567 100644
--- a/mutt.h
+++ b/mutt.h
-@@ -419,6 +419,7 @@ enum
+@@ -420,6 +420,8 @@ enum
OPTSAVEEMPTY,
OPTSAVENAME,
OPTSCORE,
+ OPTSIDEBAR,
++ OPTSIDEBARSORT,
OPTSIGDASHES,
OPTSIGONTOP,
OPTSORTRE,
-@@ -859,6 +860,7 @@ typedef struct _context
+@@ -860,6 +862,7 @@ typedef struct _context
{
char *path;
FILE *fp;
@@ -755,7 +837,7 @@ index 578d111..25822e5 100644
time_t mtime;
off_t size;
off_t vsize;
-@@ -893,6 +895,7 @@ typedef struct _context
+@@ -894,6 +897,7 @@ typedef struct _context
unsigned int quiet : 1; /* inhibit status messages? */
unsigned int collapsed : 1; /* are all threads collapsed? */
unsigned int closing : 1; /* mailbox is being closed */
@@ -764,7 +846,7 @@ index 578d111..25822e5 100644
/* driver hooks */
void *data; /* driver specific data */
diff --git a/mutt_curses.h b/mutt_curses.h
-index 854e3d5..5f61048 100644
+index f8d6f88..aee797e 100644
--- a/mutt_curses.h
+++ b/mutt_curses.h
@@ -64,6 +64,7 @@
@@ -775,7 +857,7 @@ index 854e3d5..5f61048 100644
#define CLEARLINE(x) move(x,0), clrtoeol()
#define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
#define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
-@@ -126,6 +127,8 @@ enum
+@@ -120,6 +121,8 @@ enum
MT_COLOR_BOLD,
MT_COLOR_UNDERLINE,
MT_COLOR_INDEX,
@@ -785,7 +867,7 @@ index 854e3d5..5f61048 100644
};
diff --git a/muttlib.c b/muttlib.c
-index 2160ceb..0581610 100644
+index 78c34de..b5f4d24 100644
--- a/muttlib.c
+++ b/muttlib.c
@@ -1286,6 +1286,8 @@ void mutt_FormatString (char *dest, /* output buffer */
@@ -851,7 +933,7 @@ index 2160ceb..0581610 100644
}
else if (ch == '|')
diff --git a/mx.c b/mx.c
-index 7e52714..25894df 100644
+index f599f6c..19d7c29 100644
--- a/mx.c
+++ b/mx.c
@@ -580,6 +580,7 @@ static int mx_open_mailbox_append (CONTEXT *ctx, int flags)
@@ -887,14 +969,26 @@ index 7e52714..25894df 100644
+ {
+ ut.actime = ctx->atime;
+ ut.modtime = ctx->mtime;
-+ utime (ctx->path, &ut);
++ utime (ctx->path, &ut);
+ }
+#endif
/* never announce that a mailbox we've just left has new mail. #3290
* XXX: really belongs in mx_close_mailbox, but this is a nice hook point */
+diff --git a/mx.h b/mx.h
+index 4a00715..8c6f54b 100644
+--- a/mx.h
++++ b/mx.h
+@@ -57,6 +57,7 @@ void mbox_reset_atime (CONTEXT *, struct stat *);
+ int mh_read_dir (CONTEXT *, const char *);
+ int mh_sync_mailbox (CONTEXT *, int *);
+ int mh_check_mailbox (CONTEXT *, int *);
++void mh_buffy_update (const char *, int *, int *, int *);
+ int mh_check_empty (const char *);
+
+ int maildir_read_dir (CONTEXT *);
diff --git a/pager.c b/pager.c
-index e19174c..e815c7f 100644
+index 486d8c8..ceefdb7 100644
--- a/pager.c
+++ b/pager.c
@@ -29,6 +29,7 @@
@@ -905,15 +999,15 @@ index e19174c..e815c7f 100644
#include "mutt_crypt.h"
-@@ -1099,6 +1100,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
- if (check_attachment_marker ((char *)buf) == 0)
- wrap_cols = COLS;
-
+@@ -1095,6 +1096,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
+ wchar_t wc;
+ mbstate_t mbstate;
+ int wrap_cols = mutt_term_width ((flags & M_PAGER_NOWRAP) ? 0 : Wrap);
+ wrap_cols -= SidebarWidth;
- /* FIXME: this should come from lineInfo */
- memset(&mbstate, 0, sizeof(mbstate));
-@@ -1745,7 +1747,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
+ if (check_attachment_marker ((char *)buf) == 0)
+ wrap_cols = COLS;
+@@ -1746,7 +1748,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
if ((redraw & REDRAW_BODY) || topline != oldtopline)
{
do {
@@ -922,7 +1016,7 @@ index e19174c..e815c7f 100644
curline = oldtopline = topline;
lines = 0;
force_redraw = 0;
-@@ -1758,6 +1760,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
+@@ -1759,6 +1761,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
&QuoteList, &q_level, &force_redraw, &SearchRE) > 0)
lines++;
curline++;
@@ -936,32 +1030,30 @@ index e19174c..e815c7f 100644
lines++;
+ move(lines + bodyoffset, SidebarWidth);
}
- /* We are going to update the pager status bar, so it isn't
- * necessary to reset to normal color now. */
-@@ -1794,11 +1798,11 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
- /* print out the pager status bar */
- SETCOLOR (MT_COLOR_STATUS);
- BKGDSET (MT_COLOR_STATUS);
-- CLEARLINE (statusoffset);
-+ CLEARLINE_WIN (statusoffset);
+ NORMAL_COLOR;
+
+@@ -1799,17 +1803,17 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
if (IsHeader (extra) || IsMsgAttach (extra))
{
- size_t l1 = COLS * MB_LEN_MAX;
-+ size_t l1 = (COLS-SidebarWidth) * MB_LEN_MAX;
++ size_t l1 = (COLS-SidebarWidth) * MB_LEN_MAX;
size_t l2 = sizeof (buffer);
hfi.hdr = (IsHeader (extra)) ? extra->hdr : extra->bdy->hdr;
mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT);
-@@ -1808,7 +1812,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
+- mutt_paddstr (COLS, buffer);
++ mutt_paddstr (COLS-SidebarWidth, buffer);
+ }
+ else
{
char bn[STRING];
snprintf (bn, sizeof (bn), "%s (%s)", banner, pager_progress_str);
- mutt_paddstr (COLS, bn);
-+ mutt_paddstr (COLS, IsHeader (extra) || IsMsgAttach (extra) ? buffer : banner);
++ mutt_paddstr (COLS-SidebarWidth, bn);
}
- BKGDSET (MT_COLOR_NORMAL);
- SETCOLOR (MT_COLOR_NORMAL);
-@@ -1819,18 +1823,23 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
+ NORMAL_COLOR;
+ }
+@@ -1819,16 +1823,21 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
/* redraw the pager_index indicator, because the
* flags for this message might have changed. */
menu_redraw_current (index);
@@ -973,11 +1065,9 @@ index e19174c..e815c7f 100644
- move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), 0);
+ move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), SidebarWidth);
SETCOLOR (MT_COLOR_STATUS);
- BKGDSET (MT_COLOR_STATUS);
- mutt_paddstr (COLS, buffer);
+ mutt_paddstr (COLS-SidebarWidth, buffer);
- SETCOLOR (MT_COLOR_NORMAL);
- BKGDSET (MT_COLOR_NORMAL);
+ NORMAL_COLOR;
}
+ /* if we're not using the index, update every time */
@@ -987,7 +1077,7 @@ index e19174c..e815c7f 100644
redraw = 0;
if (option(OPTBRAILLEFRIENDLY)) {
-@@ -2756,6 +2765,13 @@ search_next:
+@@ -2763,6 +2772,13 @@ search_next:
mutt_what_key ();
break;
@@ -1003,28 +1093,28 @@ index e19174c..e815c7f 100644
break;
diff --git a/sidebar.c b/sidebar.c
new file mode 100644
-index 0000000..d43a6ee
+index 0000000..6098c2a
--- /dev/null
+++ b/sidebar.c
@@ -0,0 +1,333 @@
+/*
+ * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu>
+ * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com>
-+ *
++ *
+ * 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.
-+ */
++ */
+
+
+#if HAVE_CONFIG_H
@@ -1226,7 +1316,7 @@ index 0000000..d43a6ee
+ if ( Incoming == 0 ) return 0;
+ lines = option(OPTHELP) ? 1 : 0; /* go back to the top */
+
-+ if ( known_lines != LINES || TopBuffy == 0 || BottomBuffy == 0 )
++ if ( known_lines != LINES || TopBuffy == 0 || BottomBuffy == 0 )
+ calc_boundaries(menu);
+ if ( CurBuffy == 0 ) CurBuffy = Incoming;
+
@@ -1265,7 +1355,7 @@ index 0000000..d43a6ee
+ tmp_folder_name = tmp->path + strlen(Maildir);
+ for (i = 0; i < strlen(tmp->path) - strlen(Maildir); i++) {
+ if (tmp_folder_name[i] == '/') sidebar_folder_depth++;
-+ }
++ }
+ if (sidebar_folder_depth > 0) {
+ sidebar_folder_name = malloc(strlen(basename(tmp->path)) + sidebar_folder_depth + 1);
+ for (i=0; i < sidebar_folder_depth; i++)
@@ -1342,28 +1432,28 @@ index 0000000..d43a6ee
+
diff --git a/sidebar.h b/sidebar.h
new file mode 100644
-index 0000000..c11d46d
+index 0000000..d195f11
--- /dev/null
+++ b/sidebar.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu>
+ * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com>
-+ *
++ *
+ * 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.
-+ */
++ */
+
+#ifndef SIDEBAR_H
+#define SIDEBAR_H
Please sign in to comment.
Something went wrong with that request. Please try again.