View | Details | Raw Unified | Return to bug 150703 | Differences between
and this patch

Collapse All | Expand All

(-)./Makefile (-11 / +6 lines)
Lines 117-124 Link Here
117
#
117
#
118
118
119
PORTNAME=	mutt-devel
119
PORTNAME=	mutt-devel
120
PORTVERSION=	1.5.20
120
PORTVERSION=	1.5.21
121
PORTREVISION?=	7
121
PORTREVISION?=	0
122
CATEGORIES+=	mail ipv6
122
CATEGORIES+=	mail ipv6
123
.if defined(WITH_MUTT_NNTP)
123
.if defined(WITH_MUTT_NNTP)
124
CATEGORIES+=	news
124
CATEGORIES+=	news
Lines 145-153 Link Here
145
		ftp://ftp3.mutt.org.ua/pub/mutt/mutt-${VVV_PATCH_VERSION}/:vvv \
145
		ftp://ftp3.mutt.org.ua/pub/mutt/mutt-${VVV_PATCH_VERSION}/:vvv \
146
		http://home.woolridge.ca/mutt/patches/:dw \
146
		http://home.woolridge.ca/mutt/patches/:dw \
147
		http://www.spinnaker.de/mutt/compressed/:rr \
147
		http://www.spinnaker.de/mutt/compressed/:rr \
148
		http://www.emaillab.org/mutt/${AC_PATCH_VERSION}/:jp \
148
		http://www.emaillab.org/mutt/${AC_PATCH_VERSION}/:jp
149
		http://vc.org.ua/mutt/:vc \
150
		http://yz.kiev.ua/mutt/:vc
151
149
152
MAINTAINER?=	udo.schweigert@siemens.com
150
MAINTAINER?=	udo.schweigert@siemens.com
153
COMMENT?=	The Mongrel of Mail User Agents (development version)
151
COMMENT?=	The Mongrel of Mail User Agents (development version)
Lines 178-184 Link Here
178
176
179
DW_PATCH_VERSION=	1.5.6
177
DW_PATCH_VERSION=	1.5.6
180
AC_PATCH_VERSION=	1.5.9
178
AC_PATCH_VERSION=	1.5.9
181
VC_PATCH_VERSION=	1.5.16
182
DW_MBOX_PATCH_VERSION=	1.5.18
179
DW_MBOX_PATCH_VERSION=	1.5.18
183
.if !defined(VVV_PATCH_VERSION)
180
.if !defined(VVV_PATCH_VERSION)
184
VVV_PATCH_VERSION=	${PORTVERSION}
181
VVV_PATCH_VERSION=	${PORTVERSION}
Lines 195-203 Link Here
195
.if !defined(AC_PATCH_VERSION)
192
.if !defined(AC_PATCH_VERSION)
196
AC_PATCH_VERSION=	${PORTVERSION}
193
AC_PATCH_VERSION=	${PORTVERSION}
197
.endif
194
.endif
198
.if !defined(VC_PATCH_VERSION)
199
VC_PATCH_VERSION=	${PORTVERSION}
200
.endif
201
.if defined(WITH_MUTT_MAILDIR_HEADER_CACHE)
195
.if defined(WITH_MUTT_MAILDIR_HEADER_CACHE)
202
WITH_MUTT_IMAP_HEADER_CACHE=	yes
196
WITH_MUTT_IMAP_HEADER_CACHE=	yes
203
.endif
197
.endif
Lines 438-444 Link Here
438
.endif
432
.endif
439
.endif
433
.endif
440
.if defined(WITH_MUTT_GREETING_PATCH)
434
.if defined(WITH_MUTT_GREETING_PATCH)
441
PATCHFILES+=	mutt-${VC_PATCH_VERSION}.vc.greeting:vc
435
post-patch::
436
	@${PATCH} ${PATCH_ARGS} -p1 < ${PATCHDIR}/extra-patch-greeting
442
.endif
437
.endif
443
.if defined(WITH_MUTT_TRASH_PATCH)
438
.if defined(WITH_MUTT_TRASH_PATCH)
444
post-patch::
439
post-patch::
Lines 446-452 Link Here
446
.endif
441
.endif
447
442
448
WRKSRC=		${WRKDIR}/${DISTNAME:S/i$//}
443
WRKSRC=		${WRKDIR}/${DISTNAME:S/i$//}
449
MAN1=		mutt.1 mutt_dotlock.1 flea.1 muttbug.1
444
MAN1=		mutt.1 mutt_dotlock.1 flea.1 muttbug.1 smime_keys.1
450
MAN5=		muttrc.5
445
MAN5=		muttrc.5
451
.if !defined(WITHOUT_MUTT_MAILBOX_MANPAGES)
446
.if !defined(WITHOUT_MUTT_MAILBOX_MANPAGES)
452
MAN5+=		mbox.5 mmdf.5
447
MAN5+=		mbox.5 mmdf.5
(-)./distinfo (-24 / +15 lines)
Lines 1-24 Link Here
1
MD5 (mutt/mutt-1.5.20.tar.gz) = 027cdd9959203de0c3c64149a7ee351c
1
MD5 (mutt/mutt-1.5.21.tar.gz) = a29db8f1d51e2f10c070bf88e8a553fd
2
SHA256 (mutt/mutt-1.5.20.tar.gz) = 9579fc079d74ff5c89223ff09df402ef4e508ba8ca925c49e74aa09c02a9a796
2
SHA256 (mutt/mutt-1.5.21.tar.gz) = 2141f36e8d0f4f71c9ca6780001e7cc679fe313e643953fc07f001223e67c4a0
3
SIZE (mutt/mutt-1.5.20.tar.gz) = 3635047
3
SIZE (mutt/mutt-1.5.21.tar.gz) = 3716886
4
MD5 (mutt/patch-1.5.20.rr.compressed.gz) = 5e608027bda1fddc2bc38c03a560f0a9
4
MD5 (mutt/patch-1.5.21.rr.compressed.gz) = 0632fd94c96b3e452144b730e3cf0fd3
5
SHA256 (mutt/patch-1.5.20.rr.compressed.gz) = 87a7eed23ee234fcb3564e13bb034a3bfe858fb69677c7f8e7321446acf01034
5
SHA256 (mutt/patch-1.5.21.rr.compressed.gz) = 5056b181222c4322667fd99a6314e80a4a8b4613357364d9deddef626136b4d9
6
SIZE (mutt/patch-1.5.20.rr.compressed.gz) = 10190
6
SIZE (mutt/patch-1.5.21.rr.compressed.gz) = 10133
7
MD5 (mutt/patch-1.5.20.vvv.nntp.gz) = 80355166f8ae9bff064124f2d2e6870f
7
MD5 (mutt/patch-1.5.21.vvv.nntp.gz) = afcf40f7e53a016b953cbf6af27b3cd8
8
SHA256 (mutt/patch-1.5.20.vvv.nntp.gz) = ea199ed303519ed816bded493cc4fe2985b497ec29b1c1c201f1428b1354260b
8
SHA256 (mutt/patch-1.5.21.vvv.nntp.gz) = 514cb4c3404bb68fef08781c17be41c6cd1251d05442db4105c6258f0b9d4928
9
SIZE (mutt/patch-1.5.20.vvv.nntp.gz) = 55449
9
SIZE (mutt/patch-1.5.21.vvv.nntp.gz) = 55611
10
MD5 (mutt/patch-1.5.4.cd.ifdef.1) = a545036cdb55519154d0b35465f52daa
10
MD5 (mutt/patch-1.5.21.vvv.initials.gz) = 9444edd98d52e6f6a4fa17bcc3160a93
11
SHA256 (mutt/patch-1.5.4.cd.ifdef.1) = 7d11892bcc688bbc82b5996ca0fda2d4446d8e928bec50b2731f8a3a5d9be373
11
SHA256 (mutt/patch-1.5.21.vvv.initials.gz) = ecce3643b04d1aced7085bca506896298bd56d991a5d1af057922c8358abf141
12
SIZE (mutt/patch-1.5.4.cd.ifdef.1) = 3545
12
SIZE (mutt/patch-1.5.21.vvv.initials.gz) = 691
13
MD5 (mutt/patch-1.5.20.vvv.initials.gz) = c71ebc64f20f516f45168530d57f6c21
13
MD5 (mutt/patch-1.5.21.vvv.quote.gz) = 93185b8fdf8d12f13a7a65136204193c
14
SHA256 (mutt/patch-1.5.20.vvv.initials.gz) = fc2cf1dadfab02545116fc70855cfe14f4efd8e1a32b9a6c366fc5e09bdafd23
14
SHA256 (mutt/patch-1.5.21.vvv.quote.gz) = b0613d305932b31eaf005ee0740558d46561a6d7a333c97a00d34a1d0c1ef843
15
SIZE (mutt/patch-1.5.20.vvv.initials.gz) = 690
15
SIZE (mutt/patch-1.5.21.vvv.quote.gz) = 1280
16
MD5 (mutt/patch-1.5.20.vvv.quote.gz) = 1d6213598d354942006f17b2c46720f2
17
SHA256 (mutt/patch-1.5.20.vvv.quote.gz) = 7f3ea7999f00738c2dab0e67d69d76d354d14d0615c00784233e6d1149cb749d
18
SIZE (mutt/patch-1.5.20.vvv.quote.gz) = 1772
19
MD5 (mutt/p0-patch-1.5.18.dw.mbox-hook.1) = ae70a6668e297bdc804b2673221b4727
20
SHA256 (mutt/p0-patch-1.5.18.dw.mbox-hook.1) = 12b9f41476850a5e2eed2334be9326e4905e8a6d786740689b6966a5d285070c
21
SIZE (mutt/p0-patch-1.5.18.dw.mbox-hook.1) = 6812
22
MD5 (mutt/mutt-1.5.16.vc.greeting) = 4bd9beeb74d075e4418e86e8ed887aa0
23
SHA256 (mutt/mutt-1.5.16.vc.greeting) = cf05aeab5f1813864aa72b68f59a579c46dacf2fbd8e5fd064b920012320b986
24
SIZE (mutt/mutt-1.5.16.vc.greeting) = 4526
(-)./files/extra-patch-doc-xml (-7 / +7 lines)
Lines 1-11 Link Here
1
--- doc/Makefile.am.orig2	Tue Mar  6 17:40:41 2007
1
--- doc/Makefile.am.orig	2010-09-17 16:23:30.000000000 +0200
2
+++ doc/Makefile.am	Tue Mar  6 17:42:51 2007
2
+++ doc/Makefile.am	2010-09-17 16:25:01.000000000 +0200
3
@@ -42,7 +42,7 @@
3
@@ -47,7 +47,7 @@
4
 all: ../makedoc$(EXEEXT)
5
 	$(MAKE) makedoc-all
6
 
4
 
7
-makedoc-all: mutt.1 muttrc.man
5
 all: makedoc-all
8
+makedoc-all: mutt.1 muttrc.man manual.html stamp-doc-chunked manual.txt
6
 
7
-makedoc-all: mutt.1 smime_keys.1 muttrc.man
8
+makedoc-all: mutt.1 smime_keys.1 muttrc.man manual.html stamp-doc-chunked manual.txt
9
 
9
 
10
 install-data-local: makedoc-all instdoc
10
 install-data-local: makedoc-all instdoc
11
 	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man1
11
 	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man1
(-)./files/extra-patch-greeting (+160 lines)
Line 0 Link Here
1
diff -urN mutt-1.5.19/globals.h mutt-1.5.19-vc/globals.h
2
--- mutt-1.5.19/globals.h	2009-01-04 01:27:10.000000000 +0200
3
+++ mutt-1.5.19-vc/globals.h	2009-02-09 19:30:31.000000000 +0200
4
@@ -52,6 +52,7 @@
5
 WHERE char *FolderFormat;
6
 WHERE char *ForwFmt;
7
 WHERE char *Fqdn;
8
+WHERE char *Greeting;
9
 WHERE char *HdrFmt;
10
 WHERE char *HistFile;
11
 WHERE char *Homedir;
12
diff -urN mutt-1.5.19/hdrline.c mutt-1.5.19-vc/hdrline.c
13
--- mutt-1.5.19/hdrline.c	2009-01-05 21:20:53.000000000 +0200
14
+++ mutt-1.5.19-vc/hdrline.c	2009-02-09 19:30:31.000000000 +0200
15
@@ -741,3 +741,62 @@
16
 {
17
   mutt_FormatString (dst, dstlen, 0, s, hdr_format_str, (unsigned long) hfi, flags);
18
 }
19
+
20
+/* %n = recipient name
21
+ * %u = user (login) name of recipient
22
+ * %v = first name of recipient	*/
23
+const char *
24
+greeting_string (char *dest,
25
+		size_t destlen,
26
+		size_t col,
27
+		char op,
28
+		const char *src,
29
+		const char *prefix,
30
+		const char *ifstring,
31
+		const char *elsestring,
32
+		unsigned long data,
33
+		format_flag flags)
34
+{
35
+  HEADER *hdr = (HEADER *)data;
36
+  char *p, buf2[SHORT_STRING];
37
+
38
+  dest[0] = '\0';
39
+  switch (op)
40
+  {
41
+    case 'n':
42
+      mutt_format_s (dest, destlen, prefix, mutt_get_name (hdr->env->to));
43
+      break;
44
+
45
+    case 'u':
46
+      if (hdr->env->to)
47
+      {
48
+	strfcpy (buf2, mutt_addr_for_display (hdr->env->to), sizeof (buf2));
49
+	if ((p = strpbrk (buf2, "%@")))
50
+	  *p = '\0';
51
+      }
52
+      else
53
+	buf2[0] = '\0';
54
+      mutt_format_s (dest, destlen, prefix, buf2);
55
+      break;
56
+
57
+    case 'v':
58
+      if (hdr->env->to)
59
+	mutt_format_s (buf2, sizeof (buf2), prefix, mutt_get_name (hdr->env->to));
60
+      else if (hdr->env->cc)
61
+	mutt_format_s (buf2, sizeof (buf2), prefix, mutt_get_name (hdr->env->cc));
62
+      else
63
+	*buf2 = '\0';
64
+      if ((p = strpbrk (buf2, " %@")))
65
+	*p = '\0';
66
+      mutt_format_s (dest, destlen, prefix, buf2);
67
+      break;
68
+
69
+    default:
70
+      snprintf (dest, destlen, "%%%s%c", prefix, op);
71
+      break;
72
+  }
73
+  if (flags & M_FORMAT_OPTIONAL)
74
+    mutt_FormatString (dest, destlen, col, elsestring, greeting_string, data, flags);
75
+
76
+  return(src);
77
+}
78
diff -urN mutt-1.5.19/init.h mutt-1.5.19-vc/init.h
79
--- mutt-1.5.19/init.h	2009-01-05 21:20:53.000000000 +0200
80
+++ mutt-1.5.19-vc/init.h	2009-02-09 19:30:31.000000000 +0200
81
@@ -745,6 +745,22 @@
82
   ** .pp
83
   ** This setting defaults to the contents of the environment variable \fC$$$EMAIL\fP.
84
   */
85
+  { "greeting",		DT_STR,	 R_NONE, UL &Greeting, UL "" },
86
+  /*
87
+  ** .pp
88
+  ** When set, this is the string that will precede every message as a
89
+  ** greeting phrase to the recipients.
90
+  ** .pp
91
+  ** ``Format strings'' are similar to the strings used in the ``C''
92
+  ** function printf to format output (see the man page for more detail).
93
+  ** The following sequences are defined in Mutt:
94
+  ** .pp
95
+  ** .dl
96
+  ** .dt %n .dd recipient name
97
+  ** .dt %u .dd user (login) name of recipient
98
+  ** .dt %v .dd first name of recipient
99
+  ** .de
100
+  */
101
   { "gecos_mask",	DT_RX,	 R_NONE, UL &GecosMask, UL "^[^,]*" },
102
   /*
103
   ** .pp
104
diff -urN mutt-1.5.19/PATCHES mutt-1.5.19-vc/PATCHES
105
--- mutt-1.5.19/PATCHES	2008-03-19 22:07:06.000000000 +0200
106
+++ mutt-1.5.19-vc/PATCHES	2009-02-09 19:30:31.000000000 +0200
107
@@ -0,0 +1 @@
108
+vc.greeting
109
diff -urN mutt-1.5.19/protos.h mutt-1.5.19-vc/protos.h
110
--- mutt-1.5.19/protos.h	2009-01-05 21:20:53.000000000 +0200
111
+++ mutt-1.5.19-vc/protos.h	2009-02-09 19:32:15.000000000 +0200
112
@@ -526,6 +526,9 @@
113
 void ci_bounce_message (HEADER *, int *);
114
 int ci_send_message (int, HEADER *, char *, CONTEXT *, HEADER *);
115
 
116
+const char *greeting_string (char *, size_t, size_t, char, const char *, const char *,
117
+		const char *, const char *, unsigned long, format_flag);
118
+
119
 /* prototypes for compatibility functions */
120
 
121
 #ifndef HAVE_SETENV
122
diff -urN mutt-1.5.19/send.c mutt-1.5.19-vc/send.c
123
--- mutt-1.5.19/send.c.orig	2010-09-17 16:49:09.000000000 +0200
124
+++ mutt-1.5.19-vc/send.c	2010-09-17 16:53:15.000000000 +0200
125
@@ -469,6 +469,18 @@
126
   }
127
 }
128
 
129
+void mutt_make_greeting (HEADER *hdr, FILE *out, int flags)
130
+{
131
+  char buffer[STRING];
132
+  if (Greeting)
133
+  {
134
+    mutt_FormatString(buffer, sizeof(buffer), 0, Greeting, greeting_string,
135
+		      (unsigned long) hdr, flags);
136
+    fputs(buffer, out);
137
+    fputc ('\n', out);
138
+  }
139
+}
140
+
141
 void mutt_make_post_indent (CONTEXT *ctx, HEADER *cur, FILE *out)
142
 {
143
   char buffer[STRING];
144
@@ -1003,7 +1015,6 @@
145
   }
146
 }
147
 
148
-
149
 /* look through the recipients of the message we are replying to, and if
150
    we find an address that matches $alternates, we use that as the default
151
    from field */
152
@@ -1439,6 +1450,8 @@
153
     if (option (OPTHDRS))
154
       process_user_header (msg->env);
155
 
156
+    mutt_make_greeting(msg, tempfp, flags);
157
+
158
     if (flags & SENDBATCH)
159
        mutt_copy_stream (stdin, tempfp);
160
 
(-)./files/extra-patch-sidebar (-718 / +470 lines)
Lines 1-252 Link Here
1
*** mutt-1.5.20-orig/buffy.c	2009-06-02 12:16:26.000000000 -0500
1
--- orig/buffy.c.orig	2010-09-18 14:12:40.000000000 +0200
2
--- mutt-1.5.20-patched/buffy.c	2009-06-19 22:37:02.000000000 -0500
2
+++ new/buffy.c	2010-09-18 14:17:36.000000000 +0200
3
***************
3
@@ -161,6 +161,49 @@
4
*** 159,164 ****
4
   }
5
--- 159,207 ----
5
 }
6
    }
6
 
7
  }
7
+static int buffy_compare_name(const void *a, const void *b) {
8
  
8
+  const BUFFY *b1 = * (BUFFY * const *) a;
9
+ static int buffy_compare_name(const void *a, const void *b) {
9
+  const BUFFY *b2 = * (BUFFY * const *) b;
10
+   const BUFFY *b1 = * (BUFFY * const *) a;
10
+
11
+   const BUFFY *b2 = * (BUFFY * const *) b;
11
+  return mutt_strcoll(b1->path, b2->path);
12
+ 
12
+}
13
+   return mutt_strcoll(b1->path, b2->path);
13
+
14
+ }
14
+static BUFFY *buffy_sort(BUFFY *b)
15
+ 
15
+{
16
+ static BUFFY *buffy_sort(BUFFY *b)
16
+  BUFFY *tmp = b;
17
+ {
17
+  int buffycount = 0;
18
+   BUFFY *tmp = b;
18
+  BUFFY **ary;
19
+   int buffycount = 0;
19
+  int i;
20
+   BUFFY **ary;
20
+
21
+   int i;
21
+  if (!option(OPTSIDEBARSORT))
22
+ 
22
+    return b;
23
+   if (!option(OPTSIDEBARSORT))
23
+
24
+     return b;
24
+  for (; tmp != NULL; tmp = tmp->next)
25
+ 
25
+    buffycount++;
26
+   for (; tmp != NULL; tmp = tmp->next)
26
+
27
+     buffycount++;
27
+  ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary));
28
+ 
28
+
29
+   ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary));
29
+  tmp = b;
30
+ 
30
+  for (i = 0; tmp != NULL; tmp = tmp->next, i++) {
31
+   tmp = b;
31
+    ary[i] = tmp;
32
+   for (i = 0; tmp != NULL; tmp = tmp->next, i++) {
32
+  }
33
+     ary[i] = tmp;
33
+
34
+   }
34
+  qsort(ary, buffycount, sizeof(*ary), buffy_compare_name);
35
+ 
35
+
36
+   qsort(ary, buffycount, sizeof(*ary), buffy_compare_name);
36
+  for (i = 0; i < buffycount - 1; i++) {
37
+ 
37
+    ary[i]->next = ary[i+1];
38
+   for (i = 0; i < buffycount - 1; i++) {
38
+  }
39
+     ary[i]->next = ary[i+1];
39
+  ary[buffycount - 1]->next = NULL;
40
+   }
40
+  for (i = 1; i < buffycount; i++) {
41
+   ary[buffycount - 1]->next = NULL;
41
+    ary[i]->prev = ary[i-1];
42
+   for (i = 1; i < buffycount; i++) {
42
+  }
43
+     ary[i]->prev = ary[i-1];
43
+  ary[0]->prev = NULL;
44
+   }
44
+
45
+   ary[0]->prev = NULL;
45
+  tmp = ary[0];
46
+ 
46
+  free(ary);
47
+   tmp = ary[0];
47
+  return tmp;
48
+   free(ary);
48
+}
49
+   return tmp;
49
+
50
+ }
50
 BUFFY *mutt_find_mailbox (const char *path)
51
+ 
51
 {
52
  BUFFY *mutt_find_mailbox (const char *path)
52
   BUFFY *tmp = NULL;
53
  {
53
@@ -282,6 +325,7 @@
54
    BUFFY *tmp = NULL;
54
     else
55
***************
55
       (*tmp)->size = 0;
56
*** 271,276 ****
56
   }
57
--- 314,320 ----
57
+  Incoming = buffy_sort(Incoming);
58
      else
58
   return 0;
59
        (*tmp)->size = 0;
59
 }
60
    }
60
 
61
+   Incoming = buffy_sort(Incoming);
61
@@ -371,12 +415,17 @@
62
    return 0;
62
   return rc;
63
  }
63
 }
64
  
64
 
65
***************
65
+#define STAT_CHECK_SIZE (sb.st_size > tmp->size)
66
*** 290,295 ****
66
+#define STAT_CHECK_TIME (sb.st_mtime > sb.st_atime || (tmp->newly_created && sb.st_ctime == sb.st_mtime && sb.st_ctime == sb.st_atime))
67
--- 334,340 ----
67
+#define STAT_CHECK (option(OPTCHECKMBOXSIZE) ? STAT_CHECK_SIZE : STAT_CHECK_TIME)
68
    char path[_POSIX_PATH_MAX];
68
+
69
    struct stat contex_sb;
69
 int mutt_buffy_check (int force)
70
    time_t t;
70
 {
71
+   CONTEXT *ctx;
71
   BUFFY *tmp;
72
  
72
   struct stat sb;
73
    sb.st_size=0;
73
   struct stat contex_sb;
74
    contex_sb.st_dev=0;
74
   time_t t;
75
***************
75
+  CONTEXT *ctx;
76
*** 329,334 ****
76
 
77
--- 374,381 ----
77
   sb.st_size=0;
78
    
78
   contex_sb.st_dev=0;
79
    for (tmp = Incoming; tmp; tmp = tmp->next)
79
@@ -416,6 +465,8 @@
80
    {
80
   
81
+     if ( tmp->new == 1 )
81
   for (tmp = Incoming; tmp; tmp = tmp->next)
82
   {
83
+    if ( tmp->new == 1 )
82
+       tmp->has_new = 1;
84
+       tmp->has_new = 1;
83
  #ifdef USE_IMAP
85
     if (tmp->magic != M_IMAP)
84
      if (tmp->magic != M_IMAP)
86
     {
85
  #endif
87
       tmp->new = 0;
86
***************
88
@@ -455,18 +506,122 @@
87
*** 385,394 ****
89
       {
88
        case M_MBOX:
90
       case M_MBOX:
89
        case M_MMDF:
91
       case M_MMDF:
90
  
92
-	if (buffy_mbox_hasnew (tmp, &sb) > 0)
91
! 	if (STAT_CHECK)
93
-	  BuffyCount++;
92
  	{
94
-	break;
93
! 	  BuffyCount++;
95
+        {
94
! 	  tmp->new = 1;
96
+          if (STAT_CHECK || tmp->msgcount == 0)
95
  	}
97
+          {
96
  	else if (option(OPTCHECKMBOXSIZE))
98
+            BUFFY b = *tmp;
97
  	{
99
+            int msgcount = 0;
98
--- 432,458 ----
100
+            int msg_unread = 0;
99
        case M_MBOX:
101
+            /* parse the mailbox, to see how much mail there is */
100
        case M_MMDF:
102
+            ctx = mx_open_mailbox( tmp->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL);
101
  
103
+            if(ctx)
102
!         {
104
+            {
103
! 	if (STAT_CHECK || tmp->msgcount == 0)
105
+              msgcount = ctx->msgcount;
104
  	{
106
+              msg_unread = ctx->unread;
105
! 	  BUFFY b = *tmp;
107
+              mx_close_mailbox(ctx, 0);
106
!  	  int msgcount = 0;
108
+            }
107
!  	  int msg_unread = 0;
109
+            *tmp = b;
108
!  	  /* parse the mailbox, to see how much mail there is */
110
+            tmp->msgcount = msgcount;
109
!  	  ctx = mx_open_mailbox( tmp->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL);
111
+            tmp->msg_unread = msg_unread;
110
!  	  if(ctx)
112
+            if(STAT_CHECK) {
111
!  	  {
113
+              tmp->has_new = tmp->new = 1;
112
!             msgcount = ctx->msgcount;
114
+              BuffyCount++;
113
!  	    msg_unread = ctx->unread;
115
+            }
114
!  	    mx_close_mailbox(ctx, 0);
116
+          }
115
!  	  }
117
+          else if (option(OPTCHECKMBOXSIZE))
116
!  	  *tmp = b;
118
+          {
117
!  	  tmp->msgcount = msgcount;
119
+            /* some other program has deleted mail from the folder */
118
!  	  tmp->msg_unread = msg_unread;
120
+            tmp->size = (off_t) sb.st_size;
119
!  	  if(STAT_CHECK) {
121
+          }
120
!  	    tmp->has_new = tmp->new = 1;
122
+          if (tmp->newly_created &&
121
! 	    BuffyCount++;
123
+              (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime))
122
!           }  
124
+            tmp->newly_created = 0;
123
  	}
125
+        }
124
  	else if (option(OPTCHECKMBOXSIZE))
126
+        break;
125
  	{
127
+
126
***************
128
 
127
*** 398,432 ****
129
       case M_MAILDIR:
128
  	if (tmp->newly_created &&
130
-	if (buffy_maildir_hasnew (tmp) > 0)
129
  	    (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime))
131
-	  BuffyCount++;
130
  	  tmp->newly_created = 0;
132
+        { 
131
! 
133
+        char path[_POSIX_PATH_MAX];
132
  	break;
134
+        DIR *dirp;
133
  
135
+        struct dirent *de;
134
        case M_MAILDIR:
136
+        /* count new message */
135
  
137
+        snprintf (path, sizeof (path), "%s/new", tmp->path);
136
  	snprintf (path, sizeof (path), "%s/new", tmp->path);
138
+        if ((dirp = opendir (path)) == NULL)
137
  	if ((dirp = opendir (path)) == NULL)
139
+        {
138
  	{
140
+          tmp->magic = 0;
139
  	  tmp->magic = 0;
141
+          break;
140
  	  break;
142
+        }
141
  	}
143
+        tmp->msgcount = 0;
142
  	while ((de = readdir (dirp)) != NULL)
144
+        tmp->msg_unread = 0;
143
  	{
145
+        tmp->msg_flagged = 0;
144
  	  char *p;
146
+        while ((de = readdir (dirp)) != NULL)
145
  	  if (*de->d_name != '.' && 
147
+        {
146
  	      (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')))
148
+          char *p;
147
  	  {
149
+          if (*de->d_name != '.' &&
148
! 	    /* one new and undeleted message is enough */
150
+              (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')))
149
! 	    BuffyCount++;
151
+          {
150
! 	    tmp->new = 1;
152
+            tmp->has_new = tmp->new = 1;
151
! 	    break;
153
+            tmp->msgcount++;
152
  	  }
154
+            tmp->msg_unread++;
153
  	}
155
+          }
154
  	closedir (dirp);
156
+        }
155
  	break;
157
+        if(tmp->msg_unread)
156
  
158
+          BuffyCount++;
157
        case M_MH:
159
+
158
  	if ((tmp->new = mh_buffy (tmp->path)) > 0)
160
+        closedir (dirp);
159
  	  BuffyCount++;
161
+
160
  	break;
162
+        /*
161
        }
163
+         * count read messages (for folderlist (sidebar) we also need to count
162
      }
164
+         * messages in cur so that we the total number of messages
163
--- 462,547 ----
165
+         */
164
  	if (tmp->newly_created &&
166
+        snprintf (path, sizeof (path), "%s/cur", tmp->path);
165
  	    (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime))
167
+        if ((dirp = opendir (path)) == NULL)
166
  	  tmp->newly_created = 0;
168
+        {
167
!         }
169
+          tmp->magic = 0;
168
  	break;
170
+          break;
169
  
171
+        }
170
        case M_MAILDIR:
172
+        while ((de = readdir (dirp)) != NULL)
171
  
173
+        {
172
+         /* count new message */
174
+          char *p;
173
  	snprintf (path, sizeof (path), "%s/new", tmp->path);
175
+          if (*de->d_name != '.') {
174
  	if ((dirp = opendir (path)) == NULL)
176
+                  if ((p = strstr (de->d_name, ":2,"))) {
175
  	{
177
+                          if (!strchr (p + 3, 'T')) {
176
  	  tmp->magic = 0;
178
+                                  tmp->msgcount++;
177
  	  break;
179
+                                  if ( !strchr (p + 3, 'S'))
178
  	}
180
+                                          tmp->msg_unread++;
179
+   	tmp->msgcount = 0;
181
+                                  if (strchr(p + 3, 'F'))
180
+   	tmp->msg_unread = 0;
182
+                                          tmp->msg_flagged++;
181
+   	tmp->msg_flagged = 0;
183
+                          }
182
  	while ((de = readdir (dirp)) != NULL)
184
+                  } else
183
  	{
185
+                          tmp->msgcount++;
184
  	  char *p;
186
+          }
185
  	  if (*de->d_name != '.' && 
187
+        }
186
  	      (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')))
188
+        closedir (dirp);
187
  	  {
189
+        } 
188
!  	    tmp->has_new = tmp->new = 1;
190
 	break;
189
!             tmp->msgcount++;
191
 
190
!             tmp->msg_unread++;
192
       case M_MH:
191
!  	  }
193
-	if ((tmp->new = mh_buffy (tmp->path)) > 0)
192
!  	}
194
-	  BuffyCount++;
193
!         if(tmp->msg_unread)
195
+        {
194
!           BuffyCount++;
196
+        DIR *dp;
195
!  
197
+        char path[_POSIX_PATH_MAX];
196
!  	closedir (dirp);
198
+        struct dirent *de;
197
!  
199
+        if ((tmp->new = mh_buffy (tmp->path)) > 0)
198
!         /*
200
+          BuffyCount++;
199
!          * count read messages (for folderlist (sidebar) we also need to count
201
+
200
!          * messages in cur so that we the total number of messages
202
+        if ((dp = opendir (path)) == NULL)
201
!          */
203
+          break;
202
!  	snprintf (path, sizeof (path), "%s/cur", tmp->path);
204
+        tmp->msgcount = 0;
203
!  	if ((dirp = opendir (path)) == NULL)
205
+        while ((de = readdir (dp)))
204
!   	{
206
+        {
205
!   	  tmp->magic = 0;
207
+          if (mh_valid_message (de->d_name))
206
!   	  break;
208
+          {
207
!   	}
209
+            tmp->msgcount++;
208
!   	while ((de = readdir (dirp)) != NULL)
210
+            tmp->has_new = tmp->new = 1;
209
!   	{
211
+          }
210
!   	  char *p;
212
+        }
211
!           if (*de->d_name != '.') {
213
+        closedir (dp);
212
!                   if ((p = strstr (de->d_name, ":2,"))) {
214
+        }
213
!                           if (!strchr (p + 3, 'T')) {
215
 	break;
214
!                                   tmp->msgcount++;
216
       }
215
!                                   if ( !strchr (p + 3, 'S'))
217
     }
216
!                                           tmp->msg_unread++;
217
!                                   if (strchr(p + 3, 'F'))
218
!                                           tmp->msg_flagged++;
219
!                           }
220
!                   } else
221
!                           tmp->msgcount++;
222
  	  }
223
  	}
224
  	closedir (dirp);
225
  	break;
226
  
227
        case M_MH:
228
+       {
229
+       DIR *dp;
230
+       struct dirent *de;
231
  	if ((tmp->new = mh_buffy (tmp->path)) > 0)
232
  	  BuffyCount++;
233
+     
234
+       if ((dp = opendir (path)) == NULL)
235
+         break;
236
+       tmp->msgcount = 0;
237
+       while ((de = readdir (dp)))
238
+       {
239
+         if (mh_valid_message (de->d_name))
240
+         {
241
+ 	  tmp->msgcount++;
242
+  	  tmp->has_new = tmp->new = 1;
243
+         }
244
+       }
245
+       closedir (dp);
246
+       }
247
  	break;
248
        }
249
      }
250
*** mutt-1.5.20-orig/buffy.h	2009-04-30 00:36:16.000000000 -0500
218
*** mutt-1.5.20-orig/buffy.h	2009-04-30 00:36:16.000000000 -0500
251
--- mutt-1.5.20-patched/buffy.h	2009-06-19 22:07:04.000000000 -0500
219
--- mutt-1.5.20-patched/buffy.h	2009-06-19 22:07:04.000000000 -0500
252
***************
220
***************
Lines 277-512 Link Here
277
    { NULL,		0 }
245
    { NULL,		0 }
278
  };
246
  };
279
  
247
  
280
*** mutt-1.5.20-orig/compose.c	2009-03-31 01:52:43.000000000 -0500
281
--- mutt-1.5.20-patched/compose.c	2009-06-19 22:07:04.000000000 -0500
282
***************
283
*** 72,78 ****
284
  
285
  #define HDR_XOFFSET 10
286
  #define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */
287
! #define W (COLS - HDR_XOFFSET)
288
  
289
  static char *Prompts[] =
290
  {
291
--- 72,78 ----
292
  
293
  #define HDR_XOFFSET 10
294
  #define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */
295
! #define W (COLS - HDR_XOFFSET - SidebarWidth)
296
  
297
  static char *Prompts[] =
298
  {
299
***************
300
*** 115,130 ****
301
    if ((WithCrypto & APPLICATION_PGP) && (WithCrypto & APPLICATION_SMIME))
302
    {     
303
      if (!msg->security)
304
!       mvaddstr (HDR_CRYPT, 0,     "Security: ");
305
      else if (msg->security & APPLICATION_SMIME)
306
!       mvaddstr (HDR_CRYPT, 0,     "  S/MIME: ");
307
      else if (msg->security & APPLICATION_PGP)
308
!       mvaddstr (HDR_CRYPT, 0,     "     PGP: ");
309
    }
310
    else if ((WithCrypto & APPLICATION_SMIME))
311
!     mvaddstr (HDR_CRYPT, 0,     "  S/MIME: ");
312
    else if ((WithCrypto & APPLICATION_PGP))
313
!     mvaddstr (HDR_CRYPT, 0,     "     PGP: ");
314
    else
315
      return;
316
  
317
--- 115,130 ----
318
    if ((WithCrypto & APPLICATION_PGP) && (WithCrypto & APPLICATION_SMIME))
319
    {     
320
      if (!msg->security)
321
!       mvaddstr (HDR_CRYPT, SidebarWidth,     "Security: ");
322
      else if (msg->security & APPLICATION_SMIME)
323
!       mvaddstr (HDR_CRYPT, SidebarWidth,     "  S/MIME: ");
324
      else if (msg->security & APPLICATION_PGP)
325
!       mvaddstr (HDR_CRYPT, SidebarWidth,     "     PGP: ");
326
    }
327
    else if ((WithCrypto & APPLICATION_SMIME))
328
!     mvaddstr (HDR_CRYPT, SidebarWidth,     "  S/MIME: ");
329
    else if ((WithCrypto & APPLICATION_PGP))
330
!     mvaddstr (HDR_CRYPT, SidebarWidth,     "     PGP: ");
331
    else
332
      return;
333
  
334
***************
335
*** 148,154 ****
336
      }
337
    clrtoeol ();
338
  
339
!   move (HDR_CRYPTINFO, 0);
340
    clrtoeol ();
341
    if ((WithCrypto & APPLICATION_PGP)
342
        && msg->security & APPLICATION_PGP  && msg->security & SIGN)
343
--- 148,154 ----
344
      }
345
    clrtoeol ();
346
  
347
!   move (HDR_CRYPTINFO, SidebarWidth);
348
    clrtoeol ();
349
    if ((WithCrypto & APPLICATION_PGP)
350
        && msg->security & APPLICATION_PGP  && msg->security & SIGN)
351
***************
352
*** 164,170 ****
353
        && (msg->security & ENCRYPT)
354
        && SmimeCryptAlg
355
        && *SmimeCryptAlg) {
356
!       mvprintw (HDR_CRYPTINFO, 40, "%s%s", _("Encrypt with: "),
357
  		NONULL(SmimeCryptAlg));
358
        off = 20;
359
    }
360
--- 164,170 ----
361
        && (msg->security & ENCRYPT)
362
        && SmimeCryptAlg
363
        && *SmimeCryptAlg) {
364
!       mvprintw (HDR_CRYPTINFO, SidebarWidth + 40, "%s%s", _("Encrypt with: "),
365
  		NONULL(SmimeCryptAlg));
366
        off = 20;
367
    }
368
***************
369
*** 178,184 ****
370
    int c;
371
    char *t;
372
  
373
!   mvaddstr (HDR_MIX, 0,     "     Mix: ");
374
  
375
    if (!chain)
376
    {
377
--- 178,184 ----
378
    int c;
379
    char *t;
380
  
381
!   mvaddstr (HDR_MIX, SidebarWidth,     "     Mix: ");
382
  
383
    if (!chain)
384
    {
385
***************
386
*** 193,199 ****
387
      if (t && t[0] == '0' && t[1] == '\0')
388
        t = "<random>";
389
      
390
!     if (c + mutt_strlen (t) + 2 >= COLS)
391
        break;
392
  
393
      addstr (NONULL(t));
394
--- 193,199 ----
395
      if (t && t[0] == '0' && t[1] == '\0')
396
        t = "<random>";
397
      
398
!     if (c + mutt_strlen (t) + 2 >= COLS - SidebarWidth)
399
        break;
400
  
401
      addstr (NONULL(t));
402
***************
403
*** 245,251 ****
404
  
405
    buf[0] = 0;
406
    rfc822_write_address (buf, sizeof (buf), addr, 1);
407
!   mvprintw (line, 0, TITLE_FMT, Prompts[line - 1]);
408
    mutt_paddstr (W, buf);
409
  }
410
  
411
--- 245,251 ----
412
  
413
    buf[0] = 0;
414
    rfc822_write_address (buf, sizeof (buf), addr, 1);
415
!   mvprintw (line, SidebarWidth, TITLE_FMT, Prompts[line - 1]);
416
    mutt_paddstr (W, buf);
417
  }
418
  
419
***************
420
*** 255,264 ****
421
    draw_envelope_addr (HDR_TO, msg->env->to);
422
    draw_envelope_addr (HDR_CC, msg->env->cc);
423
    draw_envelope_addr (HDR_BCC, msg->env->bcc);
424
!   mvprintw (HDR_SUBJECT, 0, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
425
    mutt_paddstr (W, NONULL (msg->env->subject));
426
    draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to);
427
!   mvprintw (HDR_FCC, 0, TITLE_FMT, Prompts[HDR_FCC - 1]);
428
    mutt_paddstr (W, fcc);
429
  
430
    if (WithCrypto)
431
--- 255,264 ----
432
    draw_envelope_addr (HDR_TO, msg->env->to);
433
    draw_envelope_addr (HDR_CC, msg->env->cc);
434
    draw_envelope_addr (HDR_BCC, msg->env->bcc);
435
!   mvprintw (HDR_SUBJECT, SidebarWidth, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
436
    mutt_paddstr (W, NONULL (msg->env->subject));
437
    draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to);
438
!   mvprintw (HDR_FCC, SidebarWidth, TITLE_FMT, Prompts[HDR_FCC - 1]);
439
    mutt_paddstr (W, fcc);
440
  
441
    if (WithCrypto)
442
***************
443
*** 269,275 ****
444
  #endif
445
  
446
    SETCOLOR (MT_COLOR_STATUS);
447
!   mvaddstr (HDR_ATTACH - 1, 0, _("-- Attachments"));
448
    BKGDSET (MT_COLOR_STATUS);
449
    clrtoeol ();
450
  
451
--- 269,275 ----
452
  #endif
453
  
454
    SETCOLOR (MT_COLOR_STATUS);
455
!   mvaddstr (HDR_ATTACH - 1, SidebarWidth, _("-- Attachments"));
456
    BKGDSET (MT_COLOR_STATUS);
457
    clrtoeol ();
458
  
459
***************
460
*** 307,313 ****
461
    /* redraw the expanded list so the user can see the result */
462
    buf[0] = 0;
463
    rfc822_write_address (buf, sizeof (buf), *addr, 1);
464
!   move (line, HDR_XOFFSET);
465
    mutt_paddstr (W, buf);
466
    
467
    return 0;
468
--- 307,313 ----
469
    /* redraw the expanded list so the user can see the result */
470
    buf[0] = 0;
471
    rfc822_write_address (buf, sizeof (buf), *addr, 1);
472
!   move (line, HDR_XOFFSET+SidebarWidth);
473
    mutt_paddstr (W, buf);
474
    
475
    return 0;
476
***************
477
*** 552,558 ****
478
  	if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0)
479
  	{
480
  	  mutt_str_replace (&msg->env->subject, buf);
481
! 	  move (HDR_SUBJECT, HDR_XOFFSET);
482
  	  clrtoeol ();
483
  	  if (msg->env->subject)
484
  	    mutt_paddstr (W, msg->env->subject);
485
--- 552,558 ----
486
  	if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0)
487
  	{
488
  	  mutt_str_replace (&msg->env->subject, buf);
489
! 	  move (HDR_SUBJECT, HDR_XOFFSET + SidebarWidth);
490
  	  clrtoeol ();
491
  	  if (msg->env->subject)
492
  	    mutt_paddstr (W, msg->env->subject);
493
***************
494
*** 569,575 ****
495
  	{
496
  	  strfcpy (fcc, buf, fcclen);
497
  	  mutt_pretty_mailbox (fcc, fcclen);
498
! 	  move (HDR_FCC, HDR_XOFFSET);
499
  	  mutt_paddstr (W, fcc);
500
  	  fccSet = 1;
501
  	}
502
--- 569,575 ----
503
  	{
504
  	  strfcpy (fcc, buf, fcclen);
505
  	  mutt_pretty_mailbox (fcc, fcclen);
506
! 	  move (HDR_FCC, HDR_XOFFSET + SidebarWidth);
507
  	  mutt_paddstr (W, fcc);
508
  	  fccSet = 1;
509
  	}
510
*** mutt-1.5.20-orig/curs_main.c	2009-06-13 21:48:36.000000000 -0500
248
*** mutt-1.5.20-orig/curs_main.c	2009-06-13 21:48:36.000000000 -0500
511
--- mutt-1.5.20-patched/curs_main.c	2009-06-19 22:07:04.000000000 -0500
249
--- mutt-1.5.20-patched/curs_main.c	2009-06-19 22:07:04.000000000 -0500
512
***************
250
***************
Lines 766-846 Link Here
766
  
504
  
767
  /* mx_open_new_message() */
505
  /* mx_open_new_message() */
768
  #define M_ADD_FROM	1	/* add a From_ line */
506
  #define M_ADD_FROM	1	/* add a From_ line */
769
*** mutt-1.5.20-orig/Makefile.am	2009-01-04 20:11:29.000000000 -0600
507
--- orig/Makefile.am.orig	2010-09-18 13:23:19.000000000 +0200
770
--- mutt-1.5.20-patched/Makefile.am	2009-06-19 22:07:04.000000000 -0500
508
+++ new/Makefile.am	2010-09-18 13:25:19.000000000 +0200
771
***************
509
@@ -34,7 +34,7 @@
772
*** 29,35 ****
510
 	score.c send.c sendlib.c signal.c sort.c \
773
  	score.c send.c sendlib.c signal.c sort.c \
511
 	status.c system.c thread.c charset.c history.c lib.c \
774
  	status.c system.c thread.c charset.c history.c lib.c \
512
 	muttlib.c editmsg.c mbyte.c \
775
  	muttlib.c editmsg.c mbyte.c \
513
-	url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c
776
! 	url.c ascii.c crypt-mod.c crypt-mod.h
514
+	url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c sidebar.c
777
  
515
 
778
  nodist_mutt_SOURCES = $(BUILT_SOURCES)
516
 nodist_mutt_SOURCES = $(BUILT_SOURCES)
779
  
517
 
780
--- 29,36 ----
518
--- orig/Makefile.in.orig	2010-09-18 13:23:19.000000000 +0200
781
  	score.c send.c sendlib.c signal.c sort.c \
519
+++ new/Makefile.in	2010-09-18 13:27:19.000000000 +0200
782
  	status.c system.c thread.c charset.c history.c lib.c \
520
@@ -89,7 +89,7 @@
783
  	muttlib.c editmsg.c mbyte.c \
521
 	system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \
784
! 	url.c ascii.c crypt-mod.c crypt-mod.h \
522
 	history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \
785
!         sidebar.c
523
 	editmsg.$(OBJEXT) mbyte.$(OBJEXT) url.$(OBJEXT) \
786
  
524
-	ascii.$(OBJEXT) crypt-mod.$(OBJEXT) safe_asprintf.$(OBJEXT)
787
  nodist_mutt_SOURCES = $(BUILT_SOURCES)
525
+	ascii.$(OBJEXT) crypt-mod.$(OBJEXT) safe_asprintf.$(OBJEXT) sidebar.$(OBJEXT)
788
  
526
 am__objects_1 =
789
*** mutt-1.5.20-orig/Makefile.in	2009-06-09 01:50:44.000000000 -0500
527
 am__objects_2 = patchlist.$(OBJEXT) $(am__objects_1)
790
--- mutt-1.5.20-patched/Makefile.in	2009-06-19 22:07:04.000000000 -0500
528
 nodist_mutt_OBJECTS = $(am__objects_2)
791
***************
529
@@ -363,7 +363,7 @@
792
*** 85,91 ****
530
 	score.c send.c sendlib.c signal.c sort.c \
793
  	system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \
531
 	status.c system.c thread.c charset.c history.c lib.c \
794
  	history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \
532
 	muttlib.c editmsg.c mbyte.c \
795
  	editmsg.$(OBJEXT) mbyte.$(OBJEXT) url.$(OBJEXT) \
533
-	url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c
796
! 	ascii.$(OBJEXT) crypt-mod.$(OBJEXT)
534
+	url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c sidebar.c
797
  am__objects_1 = patchlist.$(OBJEXT)
535
 
798
  nodist_mutt_OBJECTS = $(am__objects_1)
536
 nodist_mutt_SOURCES = $(BUILT_SOURCES)
799
  mutt_OBJECTS = $(am_mutt_OBJECTS) $(nodist_mutt_OBJECTS)
537
 mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \
800
--- 85,92 ----
538
@@ -397,7 +397,7 @@
801
  	system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \
539
 	README.SSL smime.h group.h \
802
  	history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \
540
 	muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
803
  	editmsg.$(OBJEXT) mbyte.$(OBJEXT) url.$(OBJEXT) \
541
 	ChangeLog mkchangelog.sh mutt_idna.h \
804
! 	ascii.$(OBJEXT) crypt-mod.$(OBJEXT) \
542
-	snprintf.c regex.c crypt-gpgme.h hcachever.sh.in
805
! 	sidebar.$(OBJEXT)
543
+	snprintf.c regex.c crypt-gpgme.h sidebar.h hcachever.sh.in
806
  am__objects_1 = patchlist.$(OBJEXT)
544
 
807
  nodist_mutt_OBJECTS = $(am__objects_1)
545
 EXTRA_SCRIPTS = smime_keys
808
  mutt_OBJECTS = $(am_mutt_OBJECTS) $(nodist_mutt_OBJECTS)
546
 mutt_dotlock_SOURCES = mutt_dotlock.c
809
***************
810
*** 356,362 ****
811
  	score.c send.c sendlib.c signal.c sort.c \
812
  	status.c system.c thread.c charset.c history.c lib.c \
813
  	muttlib.c editmsg.c mbyte.c \
814
! 	url.c ascii.c crypt-mod.c crypt-mod.h
815
  
816
  nodist_mutt_SOURCES = $(BUILT_SOURCES)
817
  mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \
818
--- 357,364 ----
819
  	score.c send.c sendlib.c signal.c sort.c \
820
  	status.c system.c thread.c charset.c history.c lib.c \
821
  	muttlib.c editmsg.c mbyte.c \
822
! 	url.c ascii.c crypt-mod.c crypt-mod.h \
823
! 	sidebar.c
824
  
825
  nodist_mutt_SOURCES = $(BUILT_SOURCES)
826
  mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \
827
***************
828
*** 388,394 ****
829
  	README.SSL smime.h \
830
  	muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
831
  	ChangeLog mkchangelog.sh mutt_idna.h \
832
! 	snprintf.c regex.c crypt-gpgme.h hcachever.sh.in
833
  
834
  EXTRA_SCRIPTS = smime_keys
835
  mutt_dotlock_SOURCES = mutt_dotlock.c
836
--- 390,396 ----
837
  	README.SSL smime.h \
838
  	muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
839
  	ChangeLog mkchangelog.sh mutt_idna.h \
840
! 	snprintf.c regex.c crypt-gpgme.h sidebar.h hcachever.sh.in
841
  
842
  EXTRA_SCRIPTS = smime_keys
843
  mutt_dotlock_SOURCES = mutt_dotlock.c
844
*** mutt-1.5.20-orig/mbox.c	2009-06-10 23:29:41.000000000 -0500
547
*** mutt-1.5.20-orig/mbox.c	2009-06-10 23:29:41.000000000 -0500
845
--- mutt-1.5.20-patched/mbox.c	2009-06-19 22:07:04.000000000 -0500
548
--- mutt-1.5.20-patched/mbox.c	2009-06-19 22:07:04.000000000 -0500
846
***************
549
***************
Lines 1231-1401 Link Here
1231
+ OP_SIDEBAR_NEXT "go down to next mailbox"
934
+ OP_SIDEBAR_NEXT "go down to next mailbox"
1232
+ OP_SIDEBAR_PREV "go to previous mailbox"
935
+ OP_SIDEBAR_PREV "go to previous mailbox"
1233
+ OP_SIDEBAR_OPEN "open hilighted mailbox"
936
+ OP_SIDEBAR_OPEN "open hilighted mailbox"
1234
*** mutt-1.5.20-orig/pager.c	2009-06-03 15:48:31.000000000 -0500
937
--- orig/pager.c.orig	2010-09-18 13:23:19.000000000 +0200
1235
--- mutt-1.5.20-patched/pager.c	2009-06-19 22:19:58.000000000 -0500
938
+++ new/pager.c	2010-09-18 14:03:08.000000000 +0200
1236
***************
939
@@ -29,6 +29,7 @@
1237
*** 29,34 ****
940
 #include "pager.h"
1238
--- 29,35 ----
941
 #include "attach.h"
1239
  #include "pager.h"
942
 #include "mbyte.h"
1240
  #include "attach.h"
943
+#include "sidebar.h"
1241
  #include "mbyte.h"
944
 
1242
+ #include "sidebar.h"
945
 #include "mutt_crypt.h"
1243
  
946
 
1244
  #include "mutt_crypt.h"
947
@@ -1104,6 +1105,7 @@
1245
  
948
   if (check_attachment_marker ((char *)buf) == 0)
1246
***************
949
     wrap_cols = COLS;
1247
*** 1071,1076 ****
950
 
1248
--- 1072,1079 ----
951
+  wrap_cols -= SidebarWidth;
1249
    mbstate_t mbstate;
952
   /* FIXME: this should come from lineInfo */
1250
  
953
   memset(&mbstate, 0, sizeof(mbstate));
1251
    int wrap_cols = mutt_term_width ((flags & M_PAGER_NOWRAP) ? 0 : Wrap);
954
 
1252
+ 
955
@@ -1778,7 +1780,7 @@
1253
+   wrap_cols -= SidebarWidth;
956
     if ((redraw & REDRAW_BODY) || topline != oldtopline)
1254
    
957
     {
1255
    /* FIXME: this should come from lineInfo */
958
       do {
1256
    memset(&mbstate, 0, sizeof(mbstate));
959
-	move (bodyoffset, 0);
1257
***************
960
+	move (bodyoffset, SidebarWidth);
1258
*** 1717,1723 ****
961
 	curline = oldtopline = topline;
1259
      if ((redraw & REDRAW_BODY) || topline != oldtopline)
962
 	lines = 0;
1260
      {
963
 	force_redraw = 0;
1261
        do {
964
@@ -1791,6 +1793,7 @@
1262
! 	move (bodyoffset, 0);
965
 			    &QuoteList, &q_level, &force_redraw, &SearchRE) > 0)
1263
  	curline = oldtopline = topline;
966
 	    lines++;
1264
  	lines = 0;
967
 	  curline++;
1265
  	force_redraw = 0;
968
+  	  move(lines + bodyoffset, SidebarWidth);
1266
--- 1720,1726 ----
969
 	}
1267
      if ((redraw & REDRAW_BODY) || topline != oldtopline)
970
 	last_offset = lineInfo[curline].offset;
1268
      {
971
       } while (force_redraw);
1269
        do {
972
@@ -1804,6 +1807,7 @@
1270
! 	move (bodyoffset, SidebarWidth);
973
 	  addch ('~');
1271
  	curline = oldtopline = topline;
974
 	addch ('\n');
1272
  	lines = 0;
975
 	lines++;
1273
  	force_redraw = 0;
976
+  	move(lines + bodyoffset, SidebarWidth);
1274
***************
977
       }
1275
*** 1730,1735 ****
978
       /* We are going to update the pager status bar, so it isn't
1276
--- 1733,1739 ----
979
        * necessary to reset to normal color now. */
1277
  			    &QuoteList, &q_level, &force_redraw, &SearchRE) > 0)
980
@@ -1827,21 +1831,21 @@
1278
  	    lines++;
981
       /* print out the pager status bar */
1279
  	  curline++;
982
       SETCOLOR (MT_COLOR_STATUS);
1280
+   	  move(lines + bodyoffset, SidebarWidth);
983
       BKGDSET (MT_COLOR_STATUS);
1281
  	}
984
-      CLEARLINE (statusoffset);
1282
  	last_offset = lineInfo[curline].offset;
985
+      CLEARLINE_WIN (statusoffset);
1283
        } while (force_redraw);
986
 
1284
***************
987
       if (IsHeader (extra) || IsMsgAttach (extra))
1285
*** 1743,1748 ****
988
       {
1286
--- 1747,1753 ----
989
-	size_t l1 = COLS * MB_LEN_MAX;
1287
  	  addch ('~');
990
+	size_t l1 = (COLS-SidebarWidth) * MB_LEN_MAX;
1288
  	addch ('\n');
991
 	size_t l2 = sizeof (buffer);
1289
  	lines++;
992
 	hfi.hdr = (IsHeader (extra)) ? extra->hdr : extra->bdy->hdr;
1290
+   	move(lines + bodyoffset, SidebarWidth);
993
 	mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT);
1291
        }
994
-	mutt_paddstr (COLS, buffer);
1292
        /* We are going to update the pager status bar, so it isn't
995
+	mutt_paddstr (COLS-SidebarWidth, buffer);
1293
         * necessary to reset to normal color now. */
996
       }
1294
***************
997
       else
1295
*** 1766,1786 ****
998
       {
1296
        /* print out the pager status bar */
999
 	char bn[STRING];
1297
        SETCOLOR (MT_COLOR_STATUS);
1000
 	snprintf (bn, sizeof (bn), "%s (%s)", banner, pager_progress_str);
1298
        BKGDSET (MT_COLOR_STATUS);
1001
-	mutt_paddstr (COLS, bn);
1299
!       CLEARLINE (statusoffset);
1002
+	mutt_paddstr (COLS-SidebarWidth, bn);
1300
  
1003
       }
1301
        if (IsHeader (extra) || IsMsgAttach (extra))
1004
       BKGDSET (MT_COLOR_NORMAL);
1302
        {
1005
       SETCOLOR (MT_COLOR_NORMAL);
1303
! 	size_t l1 = COLS * MB_LEN_MAX;
1006
@@ -1852,18 +1856,23 @@
1304
  	size_t l2 = sizeof (buffer);
1007
       /* redraw the pager_index indicator, because the
1305
  	hfi.hdr = (IsHeader (extra)) ? extra->hdr : extra->bdy->hdr;
1008
        * flags for this message might have changed. */
1306
  	mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT);
1009
       menu_redraw_current (index);
1307
! 	mutt_paddstr (COLS, buffer);
1010
+      draw_sidebar(MENU_PAGER);
1308
        }
1011
 
1309
        else
1012
       /* print out the index status bar */
1310
        {
1013
       menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
1311
  	char bn[STRING];
1014
  
1312
  	snprintf (bn, sizeof (bn), "%s (%s)", banner, pager_progress_str);
1015
-      move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), 0);
1313
! 	mutt_paddstr (COLS, bn);
1016
+      move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), SidebarWidth);
1314
        }
1017
       SETCOLOR (MT_COLOR_STATUS);
1315
        BKGDSET (MT_COLOR_NORMAL);
1018
       BKGDSET (MT_COLOR_STATUS);
1316
        SETCOLOR (MT_COLOR_NORMAL);
1019
-      mutt_paddstr (COLS, buffer);
1317
--- 1771,1791 ----
1020
+      mutt_paddstr (COLS-SidebarWidth, buffer);
1318
        /* print out the pager status bar */
1021
       SETCOLOR (MT_COLOR_NORMAL);
1319
        SETCOLOR (MT_COLOR_STATUS);
1022
       BKGDSET (MT_COLOR_NORMAL);
1320
        BKGDSET (MT_COLOR_STATUS);
1023
     }
1321
!       CLEARLINE_WIN (statusoffset);
1024
 
1322
  
1025
+    /* if we're not using the index, update every time */
1323
        if (IsHeader (extra) || IsMsgAttach (extra))
1026
+    if ( index == 0 )
1324
        {
1027
+      draw_sidebar(MENU_PAGER);
1325
! 	size_t l1 = (COLS-SidebarWidth) * MB_LEN_MAX;
1028
+
1326
  	size_t l2 = sizeof (buffer);
1029
     redraw = 0;
1327
  	hfi.hdr = (IsHeader (extra)) ? extra->hdr : extra->bdy->hdr;
1030
 
1328
  	mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT);
1031
     if (option(OPTBRAILLEFRIENDLY)) {
1329
! 	mutt_paddstr (COLS-SidebarWidth, buffer);
1032
@@ -2852,6 +2861,13 @@
1330
        }
1033
 	mutt_what_key ();
1331
        else
1034
 	break;
1332
        {
1035
 
1333
  	char bn[STRING];
1036
+      case OP_SIDEBAR_SCROLL_UP:
1334
  	snprintf (bn, sizeof (bn), "%s (%s)", banner, pager_progress_str);
1037
+      case OP_SIDEBAR_SCROLL_DOWN:
1335
! 	mutt_paddstr (COLS-SidebarWidth, bn);
1038
+      case OP_SIDEBAR_NEXT:
1336
        }
1039
+      case OP_SIDEBAR_PREV:
1337
        BKGDSET (MT_COLOR_NORMAL);
1040
+	scroll_sidebar(ch, MENU_PAGER);
1338
        SETCOLOR (MT_COLOR_NORMAL);
1041
+ 	break;
1339
***************
1042
+
1340
*** 1791,1808 ****
1043
       default:
1341
        /* redraw the pager_index indicator, because the
1044
 	ch = -1;
1342
         * flags for this message might have changed. */
1045
 	break;
1343
        menu_redraw_current (index);
1344
  
1345
        /* print out the index status bar */
1346
        menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
1347
   
1348
!       move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), 0);
1349
        SETCOLOR (MT_COLOR_STATUS);
1350
        BKGDSET (MT_COLOR_STATUS);
1351
!       mutt_paddstr (COLS, buffer);
1352
        SETCOLOR (MT_COLOR_NORMAL);
1353
        BKGDSET (MT_COLOR_NORMAL);
1354
      }
1355
  
1356
      redraw = 0;
1357
  
1358
      if (option(OPTBRAILLEFRIENDLY)) {
1359
--- 1796,1818 ----
1360
        /* redraw the pager_index indicator, because the
1361
         * flags for this message might have changed. */
1362
        menu_redraw_current (index);
1363
+       draw_sidebar(MENU_PAGER);
1364
  
1365
        /* print out the index status bar */
1366
        menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
1367
   
1368
!       move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), SidebarWidth);
1369
        SETCOLOR (MT_COLOR_STATUS);
1370
        BKGDSET (MT_COLOR_STATUS);
1371
!       mutt_paddstr (COLS-SidebarWidth, buffer);
1372
        SETCOLOR (MT_COLOR_NORMAL);
1373
        BKGDSET (MT_COLOR_NORMAL);
1374
      }
1375
  
1376
+     /* if we're not using the index, update every time */
1377
+     if ( index == 0 )
1378
+       draw_sidebar(MENU_PAGER);
1379
+ 
1380
      redraw = 0;
1381
  
1382
      if (option(OPTBRAILLEFRIENDLY)) {
1383
***************
1384
*** 2729,2734 ****
1385
--- 2739,2751 ----
1386
  	mutt_what_key ();
1387
  	break;
1388
  
1389
+       case OP_SIDEBAR_SCROLL_UP:
1390
+       case OP_SIDEBAR_SCROLL_DOWN:
1391
+       case OP_SIDEBAR_NEXT:
1392
+       case OP_SIDEBAR_PREV:
1393
+ 	scroll_sidebar(ch, MENU_PAGER);
1394
+  	break;
1395
+ 
1396
        default:
1397
  	ch = -1;
1398
  	break;
1399
*** mutt-1.5.20-orig/PATCHES	2008-11-11 13:55:46.000000000 -0600
1046
*** mutt-1.5.20-orig/PATCHES	2008-11-11 13:55:46.000000000 -0600
1400
--- mutt-1.5.20-patched/PATCHES	2009-06-19 22:20:31.000000000 -0500
1047
--- mutt-1.5.20-patched/PATCHES	2009-06-19 22:20:31.000000000 -0500
1401
***************
1048
***************
Lines 1849-1851 Link Here
1849
          FREE (&value);
1496
          FREE (&value);
1850
          return;
1497
          return;
1851
        }
1498
        }
1499
--- orig/compose.c.orig	2010-04-14 20:50:19.000000000 +0200
1500
+++ new/compose.c	2010-09-18 15:29:09.000000000 +0200
1501
@@ -72,7 +72,7 @@
1502
 
1503
 #define HDR_XOFFSET 10
1504
 #define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */
1505
-#define W (COLS - HDR_XOFFSET)
1506
+#define W (COLS - HDR_XOFFSET - SidebarWidth)
1507
 
1508
 static char *Prompts[] =
1509
 {
1510
@@ -112,7 +112,7 @@
1511
 {
1512
   int off = 0;
1513
 
1514
-  mvaddstr (HDR_CRYPT, 0, "Security: ");
1515
+  mvaddstr (HDR_CRYPT, SidebarWidth, "Security: ");
1516
 
1517
   if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0)
1518
   {
1519
@@ -144,7 +144,7 @@
1520
   }
1521
 
1522
   clrtoeol ();
1523
-  move (HDR_CRYPTINFO, 0);
1524
+  move (HDR_CRYPTINFO, SidebarWidth);
1525
   clrtoeol ();
1526
 
1527
   if ((WithCrypto & APPLICATION_PGP)
1528
@@ -161,7 +161,7 @@
1529
       && (msg->security & ENCRYPT)
1530
       && SmimeCryptAlg
1531
       && *SmimeCryptAlg) {
1532
-      mvprintw (HDR_CRYPTINFO, 40, "%s%s", _("Encrypt with: "),
1533
+      mvprintw (HDR_CRYPTINFO, SidebarWidth + 40, "%s%s", _("Encrypt with: "),
1534
 		NONULL(SmimeCryptAlg));
1535
       off = 20;
1536
   }
1537
@@ -190,7 +190,7 @@
1538
     if (t && t[0] == '0' && t[1] == '\0')
1539
       t = "<random>";
1540
     
1541
-    if (c + mutt_strlen (t) + 2 >= COLS)
1542
+    if (c + mutt_strlen (t) + 2 >= COLS - SidebarWidth)
1543
       break;
1544
 
1545
     addstr (NONULL(t));
1546
@@ -242,7 +242,7 @@
1547
 
1548
   buf[0] = 0;
1549
   rfc822_write_address (buf, sizeof (buf), addr, 1);
1550
-  mvprintw (line, 0, TITLE_FMT, Prompts[line - 1]);
1551
+  mvprintw (line, SidebarWidth, TITLE_FMT, Prompts[line - 1]);
1552
   mutt_paddstr (W, buf);
1553
 }
1554
 
1555
@@ -252,10 +252,10 @@
1556
   draw_envelope_addr (HDR_TO, msg->env->to);
1557
   draw_envelope_addr (HDR_CC, msg->env->cc);
1558
   draw_envelope_addr (HDR_BCC, msg->env->bcc);
1559
-  mvprintw (HDR_SUBJECT, 0, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
1560
+  mvprintw (HDR_SUBJECT, SidebarWidth, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
1561
   mutt_paddstr (W, NONULL (msg->env->subject));
1562
   draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to);
1563
-  mvprintw (HDR_FCC, 0, TITLE_FMT, Prompts[HDR_FCC - 1]);
1564
+  mvprintw (HDR_FCC, SidebarWidth, TITLE_FMT, Prompts[HDR_FCC - 1]);
1565
   mutt_paddstr (W, fcc);
1566
 
1567
   if (WithCrypto)
1568
@@ -266,7 +266,7 @@
1569
 #endif
1570
 
1571
   SETCOLOR (MT_COLOR_STATUS);
1572
-  mvaddstr (HDR_ATTACH - 1, 0, _("-- Attachments"));
1573
+  mvaddstr (HDR_ATTACH - 1, SidebarWidth, _("-- Attachments"));
1574
   BKGDSET (MT_COLOR_STATUS);
1575
   clrtoeol ();
1576
 
1577
@@ -304,7 +304,7 @@
1578
   /* redraw the expanded list so the user can see the result */
1579
   buf[0] = 0;
1580
   rfc822_write_address (buf, sizeof (buf), *addr, 1);
1581
-  move (line, HDR_XOFFSET);
1582
+  move (line, HDR_XOFFSET+SidebarWidth);
1583
   mutt_paddstr (W, buf);
1584
   
1585
   return 0;
1586
@@ -549,7 +549,7 @@
1587
 	if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0)
1588
 	{
1589
 	  mutt_str_replace (&msg->env->subject, buf);
1590
-	  move (HDR_SUBJECT, HDR_XOFFSET);
1591
+	  move (HDR_SUBJECT, HDR_XOFFSET + SidebarWidth);
1592
 	  clrtoeol ();
1593
 	  if (msg->env->subject)
1594
 	    mutt_paddstr (W, msg->env->subject);
1595
@@ -566,7 +566,7 @@
1596
 	{
1597
 	  strfcpy (fcc, buf, fcclen);
1598
 	  mutt_pretty_mailbox (fcc, fcclen);
1599
-	  move (HDR_FCC, HDR_XOFFSET);
1600
+	  move (HDR_FCC, HDR_XOFFSET + SidebarWidth);
1601
 	  mutt_paddstr (W, fcc);
1602
 	  fccSet = 1;
1603
 	}
(-)./files/extra-patch-sidebar-nntp (-523 / +377 lines)
Lines 1-252 Link Here
1
*** mutt-1.5.20-orig/buffy.c	2009-06-02 12:16:26.000000000 -0500
1
--- orig/buffy.c.orig	2010-09-18 14:12:40.000000000 +0200
2
--- mutt-1.5.20-patched/buffy.c	2009-06-19 22:37:02.000000000 -0500
2
+++ new/buffy.c	2010-09-18 14:17:36.000000000 +0200
3
***************
3
@@ -161,6 +161,49 @@
4
*** 159,164 ****
4
   }
5
--- 159,207 ----
5
 }
6
    }
6
 
7
  }
7
+static int buffy_compare_name(const void *a, const void *b) {
8
  
8
+  const BUFFY *b1 = * (BUFFY * const *) a;
9
+ static int buffy_compare_name(const void *a, const void *b) {
9
+  const BUFFY *b2 = * (BUFFY * const *) b;
10
+   const BUFFY *b1 = * (BUFFY * const *) a;
10
+
11
+   const BUFFY *b2 = * (BUFFY * const *) b;
11
+  return mutt_strcoll(b1->path, b2->path);
12
+ 
12
+}
13
+   return mutt_strcoll(b1->path, b2->path);
13
+
14
+ }
14
+static BUFFY *buffy_sort(BUFFY *b)
15
+ 
15
+{
16
+ static BUFFY *buffy_sort(BUFFY *b)
16
+  BUFFY *tmp = b;
17
+ {
17
+  int buffycount = 0;
18
+   BUFFY *tmp = b;
18
+  BUFFY **ary;
19
+   int buffycount = 0;
19
+  int i;
20
+   BUFFY **ary;
20
+
21
+   int i;
21
+  if (!option(OPTSIDEBARSORT))
22
+ 
22
+    return b;
23
+   if (!option(OPTSIDEBARSORT))
23
+
24
+     return b;
24
+  for (; tmp != NULL; tmp = tmp->next)
25
+ 
25
+    buffycount++;
26
+   for (; tmp != NULL; tmp = tmp->next)
26
+
27
+     buffycount++;
27
+  ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary));
28
+ 
28
+
29
+   ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary));
29
+  tmp = b;
30
+ 
30
+  for (i = 0; tmp != NULL; tmp = tmp->next, i++) {
31
+   tmp = b;
31
+    ary[i] = tmp;
32
+   for (i = 0; tmp != NULL; tmp = tmp->next, i++) {
32
+  }
33
+     ary[i] = tmp;
33
+
34
+   }
34
+  qsort(ary, buffycount, sizeof(*ary), buffy_compare_name);
35
+ 
35
+
36
+   qsort(ary, buffycount, sizeof(*ary), buffy_compare_name);
36
+  for (i = 0; i < buffycount - 1; i++) {
37
+ 
37
+    ary[i]->next = ary[i+1];
38
+   for (i = 0; i < buffycount - 1; i++) {
38
+  }
39
+     ary[i]->next = ary[i+1];
39
+  ary[buffycount - 1]->next = NULL;
40
+   }
40
+  for (i = 1; i < buffycount; i++) {
41
+   ary[buffycount - 1]->next = NULL;
41
+    ary[i]->prev = ary[i-1];
42
+   for (i = 1; i < buffycount; i++) {
42
+  }
43
+     ary[i]->prev = ary[i-1];
43
+  ary[0]->prev = NULL;
44
+   }
44
+
45
+   ary[0]->prev = NULL;
45
+  tmp = ary[0];
46
+ 
46
+  free(ary);
47
+   tmp = ary[0];
47
+  return tmp;
48
+   free(ary);
48
+}
49
+   return tmp;
49
+
50
+ }
50
 BUFFY *mutt_find_mailbox (const char *path)
51
+ 
51
 {
52
  BUFFY *mutt_find_mailbox (const char *path)
52
   BUFFY *tmp = NULL;
53
  {
53
@@ -282,6 +325,7 @@
54
    BUFFY *tmp = NULL;
54
     else
55
***************
55
       (*tmp)->size = 0;
56
*** 271,276 ****
56
   }
57
--- 314,320 ----
57
+  Incoming = buffy_sort(Incoming);
58
      else
58
   return 0;
59
        (*tmp)->size = 0;
59
 }
60
    }
60
 
61
+   Incoming = buffy_sort(Incoming);
61
@@ -371,12 +415,17 @@
62
    return 0;
62
   return rc;
63
  }
63
 }
64
  
64
 
65
***************
65
+#define STAT_CHECK_SIZE (sb.st_size > tmp->size)
66
*** 290,295 ****
66
+#define STAT_CHECK_TIME (sb.st_mtime > sb.st_atime || (tmp->newly_created && sb.st_ctime == sb.st_mtime && sb.st_ctime == sb.st_atime))
67
--- 334,340 ----
67
+#define STAT_CHECK (option(OPTCHECKMBOXSIZE) ? STAT_CHECK_SIZE : STAT_CHECK_TIME)
68
    char path[_POSIX_PATH_MAX];
68
+
69
    struct stat contex_sb;
69
 int mutt_buffy_check (int force)
70
    time_t t;
70
 {
71
+   CONTEXT *ctx;
71
   BUFFY *tmp;
72
  
72
   struct stat sb;
73
    sb.st_size=0;
73
   struct stat contex_sb;
74
    contex_sb.st_dev=0;
74
   time_t t;
75
***************
75
+  CONTEXT *ctx;
76
*** 329,334 ****
76
 
77
--- 374,381 ----
77
   sb.st_size=0;
78
    
78
   contex_sb.st_dev=0;
79
    for (tmp = Incoming; tmp; tmp = tmp->next)
79
@@ -416,6 +465,8 @@
80
    {
80
   
81
+     if ( tmp->new == 1 )
81
   for (tmp = Incoming; tmp; tmp = tmp->next)
82
   {
83
+    if ( tmp->new == 1 )
82
+       tmp->has_new = 1;
84
+       tmp->has_new = 1;
83
  #ifdef USE_IMAP
85
     if (tmp->magic != M_IMAP)
84
      if (tmp->magic != M_IMAP)
86
     {
85
  #endif
87
       tmp->new = 0;
86
***************
88
@@ -455,18 +506,122 @@
87
*** 385,394 ****
89
       {
88
        case M_MBOX:
90
       case M_MBOX:
89
        case M_MMDF:
91
       case M_MMDF:
90
  
92
-	if (buffy_mbox_hasnew (tmp, &sb) > 0)
91
! 	if (STAT_CHECK)
93
-	  BuffyCount++;
92
  	{
94
-	break;
93
! 	  BuffyCount++;
95
+        {
94
! 	  tmp->new = 1;
96
+          if (STAT_CHECK || tmp->msgcount == 0)
95
  	}
97
+          {
96
  	else if (option(OPTCHECKMBOXSIZE))
98
+            BUFFY b = *tmp;
97
  	{
99
+            int msgcount = 0;
98
--- 432,458 ----
100
+            int msg_unread = 0;
99
        case M_MBOX:
101
+            /* parse the mailbox, to see how much mail there is */
100
        case M_MMDF:
102
+            ctx = mx_open_mailbox( tmp->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL);
101
  
103
+            if(ctx)
102
!         {
104
+            {
103
! 	if (STAT_CHECK || tmp->msgcount == 0)
105
+              msgcount = ctx->msgcount;
104
  	{
106
+              msg_unread = ctx->unread;
105
! 	  BUFFY b = *tmp;
107
+              mx_close_mailbox(ctx, 0);
106
!  	  int msgcount = 0;
108
+            }
107
!  	  int msg_unread = 0;
109
+            *tmp = b;
108
!  	  /* parse the mailbox, to see how much mail there is */
110
+            tmp->msgcount = msgcount;
109
!  	  ctx = mx_open_mailbox( tmp->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL);
111
+            tmp->msg_unread = msg_unread;
110
!  	  if(ctx)
112
+            if(STAT_CHECK) {
111
!  	  {
113
+              tmp->has_new = tmp->new = 1;
112
!             msgcount = ctx->msgcount;
114
+              BuffyCount++;
113
!  	    msg_unread = ctx->unread;
115
+            }
114
!  	    mx_close_mailbox(ctx, 0);
116
+          }
115
!  	  }
117
+          else if (option(OPTCHECKMBOXSIZE))
116
!  	  *tmp = b;
118
+          {
117
!  	  tmp->msgcount = msgcount;
119
+            /* some other program has deleted mail from the folder */
118
!  	  tmp->msg_unread = msg_unread;
120
+            tmp->size = (off_t) sb.st_size;
119
!  	  if(STAT_CHECK) {
121
+          }
120
!  	    tmp->has_new = tmp->new = 1;
122
+          if (tmp->newly_created &&
121
! 	    BuffyCount++;
123
+              (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime))
122
!           }  
124
+            tmp->newly_created = 0;
123
  	}
125
+        }
124
  	else if (option(OPTCHECKMBOXSIZE))
126
+        break;
125
  	{
127
+
126
***************
128
 
127
*** 398,432 ****
129
       case M_MAILDIR:
128
  	if (tmp->newly_created &&
130
-	if (buffy_maildir_hasnew (tmp) > 0)
129
  	    (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime))
131
-	  BuffyCount++;
130
  	  tmp->newly_created = 0;
132
+        { 
131
! 
133
+        char path[_POSIX_PATH_MAX];
132
  	break;
134
+        DIR *dirp;
133
  
135
+        struct dirent *de;
134
        case M_MAILDIR:
136
+        /* count new message */
135
  
137
+        snprintf (path, sizeof (path), "%s/new", tmp->path);
136
  	snprintf (path, sizeof (path), "%s/new", tmp->path);
138
+        if ((dirp = opendir (path)) == NULL)
137
  	if ((dirp = opendir (path)) == NULL)
139
+        {
138
  	{
140
+          tmp->magic = 0;
139
  	  tmp->magic = 0;
141
+          break;
140
  	  break;
142
+        }
141
  	}
143
+        tmp->msgcount = 0;
142
  	while ((de = readdir (dirp)) != NULL)
144
+        tmp->msg_unread = 0;
143
  	{
145
+        tmp->msg_flagged = 0;
144
  	  char *p;
146
+        while ((de = readdir (dirp)) != NULL)
145
  	  if (*de->d_name != '.' && 
147
+        {
146
  	      (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')))
148
+          char *p;
147
  	  {
149
+          if (*de->d_name != '.' &&
148
! 	    /* one new and undeleted message is enough */
150
+              (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')))
149
! 	    BuffyCount++;
151
+          {
150
! 	    tmp->new = 1;
152
+            tmp->has_new = tmp->new = 1;
151
! 	    break;
153
+            tmp->msgcount++;
152
  	  }
154
+            tmp->msg_unread++;
153
  	}
155
+          }
154
  	closedir (dirp);
156
+        }
155
  	break;
157
+        if(tmp->msg_unread)
156
  
158
+          BuffyCount++;
157
        case M_MH:
159
+
158
  	if ((tmp->new = mh_buffy (tmp->path)) > 0)
160
+        closedir (dirp);
159
  	  BuffyCount++;
161
+
160
  	break;
162
+        /*
161
        }
163
+         * count read messages (for folderlist (sidebar) we also need to count
162
      }
164
+         * messages in cur so that we the total number of messages
163
--- 462,547 ----
165
+         */
164
  	if (tmp->newly_created &&
166
+        snprintf (path, sizeof (path), "%s/cur", tmp->path);
165
  	    (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime))
167
+        if ((dirp = opendir (path)) == NULL)
166
  	  tmp->newly_created = 0;
168
+        {
167
!         }
169
+          tmp->magic = 0;
168
  	break;
170
+          break;
169
  
171
+        }
170
        case M_MAILDIR:
172
+        while ((de = readdir (dirp)) != NULL)
171
  
173
+        {
172
+         /* count new message */
174
+          char *p;
173
  	snprintf (path, sizeof (path), "%s/new", tmp->path);
175
+          if (*de->d_name != '.') {
174
  	if ((dirp = opendir (path)) == NULL)
176
+                  if ((p = strstr (de->d_name, ":2,"))) {
175
  	{
177
+                          if (!strchr (p + 3, 'T')) {
176
  	  tmp->magic = 0;
178
+                                  tmp->msgcount++;
177
  	  break;
179
+                                  if ( !strchr (p + 3, 'S'))
178
  	}
180
+                                          tmp->msg_unread++;
179
+   	tmp->msgcount = 0;
181
+                                  if (strchr(p + 3, 'F'))
180
+   	tmp->msg_unread = 0;
182
+                                          tmp->msg_flagged++;
181
+   	tmp->msg_flagged = 0;
183
+                          }
182
  	while ((de = readdir (dirp)) != NULL)
184
+                  } else
183
  	{
185
+                          tmp->msgcount++;
184
  	  char *p;
186
+          }
185
  	  if (*de->d_name != '.' && 
187
+        }
186
  	      (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')))
188
+        closedir (dirp);
187
  	  {
189
+        } 
188
!  	    tmp->has_new = tmp->new = 1;
190
 	break;
189
!             tmp->msgcount++;
191
 
190
!             tmp->msg_unread++;
192
       case M_MH:
191
!  	  }
193
-	if ((tmp->new = mh_buffy (tmp->path)) > 0)
192
!  	}
194
-	  BuffyCount++;
193
!         if(tmp->msg_unread)
195
+        {
194
!           BuffyCount++;
196
+        DIR *dp;
195
!  
197
+        char path[_POSIX_PATH_MAX];
196
!  	closedir (dirp);
198
+        struct dirent *de;
197
!  
199
+        if ((tmp->new = mh_buffy (tmp->path)) > 0)
198
!         /*
200
+          BuffyCount++;
199
!          * count read messages (for folderlist (sidebar) we also need to count
201
+
200
!          * messages in cur so that we the total number of messages
202
+        if ((dp = opendir (path)) == NULL)
201
!          */
203
+          break;
202
!  	snprintf (path, sizeof (path), "%s/cur", tmp->path);
204
+        tmp->msgcount = 0;
203
!  	if ((dirp = opendir (path)) == NULL)
205
+        while ((de = readdir (dp)))
204
!   	{
206
+        {
205
!   	  tmp->magic = 0;
207
+          if (mh_valid_message (de->d_name))
206
!   	  break;
208
+          {
207
!   	}
209
+            tmp->msgcount++;
208
!   	while ((de = readdir (dirp)) != NULL)
210
+            tmp->has_new = tmp->new = 1;
209
!   	{
211
+          }
210
!   	  char *p;
212
+        }
211
!           if (*de->d_name != '.') {
213
+        closedir (dp);
212
!                   if ((p = strstr (de->d_name, ":2,"))) {
214
+        }
213
!                           if (!strchr (p + 3, 'T')) {
215
 	break;
214
!                                   tmp->msgcount++;
216
       }
215
!                                   if ( !strchr (p + 3, 'S'))
217
     }
216
!                                           tmp->msg_unread++;
217
!                                   if (strchr(p + 3, 'F'))
218
!                                           tmp->msg_flagged++;
219
!                           }
220
!                   } else
221
!                           tmp->msgcount++;
222
  	  }
223
  	}
224
  	closedir (dirp);
225
  	break;
226
  
227
        case M_MH:
228
+       {
229
+       DIR *dp;
230
+       struct dirent *de;
231
  	if ((tmp->new = mh_buffy (tmp->path)) > 0)
232
  	  BuffyCount++;
233
+     
234
+       if ((dp = opendir (path)) == NULL)
235
+         break;
236
+       tmp->msgcount = 0;
237
+       while ((de = readdir (dp)))
238
+       {
239
+         if (mh_valid_message (de->d_name))
240
+         {
241
+ 	  tmp->msgcount++;
242
+  	  tmp->has_new = tmp->new = 1;
243
+         }
244
+       }
245
+       closedir (dp);
246
+       }
247
  	break;
248
        }
249
      }
250
*** mutt-1.5.20-orig/buffy.h	2009-04-30 00:36:16.000000000 -0500
218
*** mutt-1.5.20-orig/buffy.h	2009-04-30 00:36:16.000000000 -0500
251
--- mutt-1.5.20-patched/buffy.h	2009-06-19 22:07:04.000000000 -0500
219
--- mutt-1.5.20-patched/buffy.h	2009-06-19 22:07:04.000000000 -0500
252
***************
220
***************
Lines 536-616 Link Here
536
  
504
  
537
  /* mx_open_new_message() */
505
  /* mx_open_new_message() */
538
  #define M_ADD_FROM	1	/* add a From_ line */
506
  #define M_ADD_FROM	1	/* add a From_ line */
539
*** mutt-1.5.20-orig/Makefile.am	2009-01-04 20:11:29.000000000 -0600
507
--- orig/Makefile.am.orig	2010-09-18 13:23:19.000000000 +0200
540
--- mutt-1.5.20-patched/Makefile.am	2009-06-19 22:07:04.000000000 -0500
508
+++ new/Makefile.am	2010-09-18 13:25:19.000000000 +0200
541
***************
509
@@ -34,7 +34,7 @@
542
*** 29,35 ****
510
 	score.c send.c sendlib.c signal.c sort.c \
543
  	score.c send.c sendlib.c signal.c sort.c \
511
 	status.c system.c thread.c charset.c history.c lib.c \
544
  	status.c system.c thread.c charset.c history.c lib.c \
512
 	muttlib.c editmsg.c mbyte.c \
545
  	muttlib.c editmsg.c mbyte.c \
513
-	url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c
546
! 	url.c ascii.c crypt-mod.c crypt-mod.h
514
+	url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c sidebar.c
547
  
515
 
548
  nodist_mutt_SOURCES = $(BUILT_SOURCES)
516
 nodist_mutt_SOURCES = $(BUILT_SOURCES)
549
  
517
 
550
--- 29,36 ----
518
--- orig/Makefile.in.orig	2010-09-18 13:23:19.000000000 +0200
551
  	score.c send.c sendlib.c signal.c sort.c \
519
+++ new/Makefile.in	2010-09-18 13:27:19.000000000 +0200
552
  	status.c system.c thread.c charset.c history.c lib.c \
520
@@ -89,7 +89,7 @@
553
  	muttlib.c editmsg.c mbyte.c \
521
 	system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \
554
! 	url.c ascii.c crypt-mod.c crypt-mod.h \
522
 	history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \
555
!         sidebar.c
523
 	editmsg.$(OBJEXT) mbyte.$(OBJEXT) url.$(OBJEXT) \
556
  
524
-	ascii.$(OBJEXT) crypt-mod.$(OBJEXT) safe_asprintf.$(OBJEXT)
557
  nodist_mutt_SOURCES = $(BUILT_SOURCES)
525
+	ascii.$(OBJEXT) crypt-mod.$(OBJEXT) safe_asprintf.$(OBJEXT) sidebar.$(OBJEXT)
558
  
526
 am__objects_1 =
559
*** mutt-1.5.20-orig/Makefile.in	2009-06-09 01:50:44.000000000 -0500
527
 am__objects_2 = patchlist.$(OBJEXT) $(am__objects_1)
560
--- mutt-1.5.20-patched/Makefile.in	2009-06-19 22:07:04.000000000 -0500
528
 nodist_mutt_OBJECTS = $(am__objects_2)
561
***************
529
@@ -363,7 +363,7 @@
562
*** 85,91 ****
530
 	score.c send.c sendlib.c signal.c sort.c \
563
  	system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \
531
 	status.c system.c thread.c charset.c history.c lib.c \
564
  	history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \
532
 	muttlib.c editmsg.c mbyte.c \
565
  	editmsg.$(OBJEXT) mbyte.$(OBJEXT) url.$(OBJEXT) \
533
-	url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c
566
! 	ascii.$(OBJEXT) crypt-mod.$(OBJEXT)
534
+	url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c sidebar.c
567
  am__objects_1 = patchlist.$(OBJEXT)
535
 
568
  nodist_mutt_OBJECTS = $(am__objects_1)
536
 nodist_mutt_SOURCES = $(BUILT_SOURCES)
569
  mutt_OBJECTS = $(am_mutt_OBJECTS) $(nodist_mutt_OBJECTS)
537
 mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \
570
--- 85,92 ----
538
@@ -397,7 +397,7 @@
571
  	system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \
539
 	README.SSL smime.h group.h \
572
  	history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \
540
 	muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
573
  	editmsg.$(OBJEXT) mbyte.$(OBJEXT) url.$(OBJEXT) \
541
 	ChangeLog mkchangelog.sh mutt_idna.h \
574
! 	ascii.$(OBJEXT) crypt-mod.$(OBJEXT) \
542
-	snprintf.c regex.c crypt-gpgme.h hcachever.sh.in
575
! 	sidebar.$(OBJEXT)
543
+	snprintf.c regex.c crypt-gpgme.h sidebar.h hcachever.sh.in
576
  am__objects_1 = patchlist.$(OBJEXT)
544
 
577
  nodist_mutt_OBJECTS = $(am__objects_1)
545
 EXTRA_SCRIPTS = smime_keys
578
  mutt_OBJECTS = $(am_mutt_OBJECTS) $(nodist_mutt_OBJECTS)
546
 mutt_dotlock_SOURCES = mutt_dotlock.c
579
***************
580
*** 356,362 ****
581
  	score.c send.c sendlib.c signal.c sort.c \
582
  	status.c system.c thread.c charset.c history.c lib.c \
583
  	muttlib.c editmsg.c mbyte.c \
584
! 	url.c ascii.c crypt-mod.c crypt-mod.h
585
  
586
  nodist_mutt_SOURCES = $(BUILT_SOURCES)
587
  mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \
588
--- 357,364 ----
589
  	score.c send.c sendlib.c signal.c sort.c \
590
  	status.c system.c thread.c charset.c history.c lib.c \
591
  	muttlib.c editmsg.c mbyte.c \
592
! 	url.c ascii.c crypt-mod.c crypt-mod.h \
593
! 	sidebar.c
594
  
595
  nodist_mutt_SOURCES = $(BUILT_SOURCES)
596
  mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \
597
***************
598
*** 388,394 ****
599
  	README.SSL smime.h \
600
  	muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
601
  	ChangeLog mkchangelog.sh mutt_idna.h \
602
! 	snprintf.c regex.c crypt-gpgme.h hcachever.sh.in
603
  
604
  EXTRA_SCRIPTS = smime_keys
605
  mutt_dotlock_SOURCES = mutt_dotlock.c
606
--- 390,396 ----
607
  	README.SSL smime.h \
608
  	muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
609
  	ChangeLog mkchangelog.sh mutt_idna.h \
610
! 	snprintf.c regex.c crypt-gpgme.h sidebar.h hcachever.sh.in
611
  
612
  EXTRA_SCRIPTS = smime_keys
613
  mutt_dotlock_SOURCES = mutt_dotlock.c
614
*** mutt-1.5.20-orig/mbox.c	2009-06-10 23:29:41.000000000 -0500
547
*** mutt-1.5.20-orig/mbox.c	2009-06-10 23:29:41.000000000 -0500
615
--- mutt-1.5.20-patched/mbox.c	2009-06-19 22:07:04.000000000 -0500
548
--- mutt-1.5.20-patched/mbox.c	2009-06-19 22:07:04.000000000 -0500
616
***************
549
***************
Lines 1001-1171 Link Here
1001
+ OP_SIDEBAR_NEXT "go down to next mailbox"
934
+ OP_SIDEBAR_NEXT "go down to next mailbox"
1002
+ OP_SIDEBAR_PREV "go to previous mailbox"
935
+ OP_SIDEBAR_PREV "go to previous mailbox"
1003
+ OP_SIDEBAR_OPEN "open hilighted mailbox"
936
+ OP_SIDEBAR_OPEN "open hilighted mailbox"
1004
*** mutt-1.5.20-orig/pager.c	2009-06-03 15:48:31.000000000 -0500
937
--- orig/pager.c.orig	2010-09-18 13:23:19.000000000 +0200
1005
--- mutt-1.5.20-patched/pager.c	2009-06-19 22:19:58.000000000 -0500
938
+++ new/pager.c	2010-09-18 14:03:08.000000000 +0200
1006
***************
939
@@ -29,6 +29,7 @@
1007
*** 29,34 ****
940
 #include "pager.h"
1008
--- 29,35 ----
941
 #include "attach.h"
1009
  #include "pager.h"
942
 #include "mbyte.h"
1010
  #include "attach.h"
943
+#include "sidebar.h"
1011
  #include "mbyte.h"
944
 
1012
+ #include "sidebar.h"
945
 #include "mutt_crypt.h"
1013
  
946
 
1014
  #include "mutt_crypt.h"
947
@@ -1104,6 +1105,7 @@
1015
  
948
   if (check_attachment_marker ((char *)buf) == 0)
1016
***************
949
     wrap_cols = COLS;
1017
*** 1071,1076 ****
950
 
1018
--- 1072,1079 ----
951
+  wrap_cols -= SidebarWidth;
1019
    mbstate_t mbstate;
952
   /* FIXME: this should come from lineInfo */
1020
  
953
   memset(&mbstate, 0, sizeof(mbstate));
1021
    int wrap_cols = mutt_term_width ((flags & M_PAGER_NOWRAP) ? 0 : Wrap);
954
 
1022
+ 
955
@@ -1778,7 +1780,7 @@
1023
+   wrap_cols -= SidebarWidth;
956
     if ((redraw & REDRAW_BODY) || topline != oldtopline)
1024
    
957
     {
1025
    /* FIXME: this should come from lineInfo */
958
       do {
1026
    memset(&mbstate, 0, sizeof(mbstate));
959
-	move (bodyoffset, 0);
1027
***************
960
+	move (bodyoffset, SidebarWidth);
1028
*** 1717,1723 ****
961
 	curline = oldtopline = topline;
1029
      if ((redraw & REDRAW_BODY) || topline != oldtopline)
962
 	lines = 0;
1030
      {
963
 	force_redraw = 0;
1031
        do {
964
@@ -1791,6 +1793,7 @@
1032
! 	move (bodyoffset, 0);
965
 			    &QuoteList, &q_level, &force_redraw, &SearchRE) > 0)
1033
  	curline = oldtopline = topline;
966
 	    lines++;
1034
  	lines = 0;
967
 	  curline++;
1035
  	force_redraw = 0;
968
+  	  move(lines + bodyoffset, SidebarWidth);
1036
--- 1720,1726 ----
969
 	}
1037
      if ((redraw & REDRAW_BODY) || topline != oldtopline)
970
 	last_offset = lineInfo[curline].offset;
1038
      {
971
       } while (force_redraw);
1039
        do {
972
@@ -1804,6 +1807,7 @@
1040
! 	move (bodyoffset, SidebarWidth);
973
 	  addch ('~');
1041
  	curline = oldtopline = topline;
974
 	addch ('\n');
1042
  	lines = 0;
975
 	lines++;
1043
  	force_redraw = 0;
976
+  	move(lines + bodyoffset, SidebarWidth);
1044
***************
977
       }
1045
*** 1730,1735 ****
978
       /* We are going to update the pager status bar, so it isn't
1046
--- 1733,1739 ----
979
        * necessary to reset to normal color now. */
1047
  			    &QuoteList, &q_level, &force_redraw, &SearchRE) > 0)
980
@@ -1827,21 +1831,21 @@
1048
  	    lines++;
981
       /* print out the pager status bar */
1049
  	  curline++;
982
       SETCOLOR (MT_COLOR_STATUS);
1050
+   	  move(lines + bodyoffset, SidebarWidth);
983
       BKGDSET (MT_COLOR_STATUS);
1051
  	}
984
-      CLEARLINE (statusoffset);
1052
  	last_offset = lineInfo[curline].offset;
985
+      CLEARLINE_WIN (statusoffset);
1053
        } while (force_redraw);
986
 
1054
***************
987
       if (IsHeader (extra) || IsMsgAttach (extra))
1055
*** 1743,1748 ****
988
       {
1056
--- 1747,1753 ----
989
-	size_t l1 = COLS * MB_LEN_MAX;
1057
  	  addch ('~');
990
+	size_t l1 = (COLS-SidebarWidth) * MB_LEN_MAX;
1058
  	addch ('\n');
991
 	size_t l2 = sizeof (buffer);
1059
  	lines++;
992
 	hfi.hdr = (IsHeader (extra)) ? extra->hdr : extra->bdy->hdr;
1060
+   	move(lines + bodyoffset, SidebarWidth);
993
 	mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT);
1061
        }
994
-	mutt_paddstr (COLS, buffer);
1062
        /* We are going to update the pager status bar, so it isn't
995
+	mutt_paddstr (COLS-SidebarWidth, buffer);
1063
         * necessary to reset to normal color now. */
996
       }
1064
***************
997
       else
1065
*** 1766,1786 ****
998
       {
1066
        /* print out the pager status bar */
999
 	char bn[STRING];
1067
        SETCOLOR (MT_COLOR_STATUS);
1000
 	snprintf (bn, sizeof (bn), "%s (%s)", banner, pager_progress_str);
1068
        BKGDSET (MT_COLOR_STATUS);
1001
-	mutt_paddstr (COLS, bn);
1069
!       CLEARLINE (statusoffset);
1002
+	mutt_paddstr (COLS-SidebarWidth, bn);
1070
  
1003
       }
1071
        if (IsHeader (extra) || IsMsgAttach (extra))
1004
       BKGDSET (MT_COLOR_NORMAL);
1072
        {
1005
       SETCOLOR (MT_COLOR_NORMAL);
1073
! 	size_t l1 = COLS * MB_LEN_MAX;
1006
@@ -1852,18 +1856,23 @@
1074
  	size_t l2 = sizeof (buffer);
1007
       /* redraw the pager_index indicator, because the
1075
  	hfi.hdr = (IsHeader (extra)) ? extra->hdr : extra->bdy->hdr;
1008
        * flags for this message might have changed. */
1076
  	mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT);
1009
       menu_redraw_current (index);
1077
! 	mutt_paddstr (COLS, buffer);
1010
+      draw_sidebar(MENU_PAGER);
1078
        }
1011
 
1079
        else
1012
       /* print out the index status bar */
1080
        {
1013
       menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
1081
  	char bn[STRING];
1082
  	snprintf (bn, sizeof (bn), "%s (%s)", banner, pager_progress_str);
1083
! 	mutt_paddstr (COLS, bn);
1084
        }
1085
        BKGDSET (MT_COLOR_NORMAL);
1086
        SETCOLOR (MT_COLOR_NORMAL);
1087
--- 1771,1791 ----
1088
        /* print out the pager status bar */
1089
        SETCOLOR (MT_COLOR_STATUS);
1090
        BKGDSET (MT_COLOR_STATUS);
1091
!       CLEARLINE_WIN (statusoffset);
1092
  
1093
        if (IsHeader (extra) || IsMsgAttach (extra))
1094
        {
1095
! 	size_t l1 = (COLS-SidebarWidth) * MB_LEN_MAX;
1096
  	size_t l2 = sizeof (buffer);
1097
  	hfi.hdr = (IsHeader (extra)) ? extra->hdr : extra->bdy->hdr;
1098
  	mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT);
1099
! 	mutt_paddstr (COLS-SidebarWidth, buffer);
1100
        }
1101
        else
1102
        {
1103
  	char bn[STRING];
1104
  	snprintf (bn, sizeof (bn), "%s (%s)", banner, pager_progress_str);
1105
! 	mutt_paddstr (COLS-SidebarWidth, bn);
1106
        }
1107
        BKGDSET (MT_COLOR_NORMAL);
1108
        SETCOLOR (MT_COLOR_NORMAL);
1109
***************
1110
*** 1791,1808 ****
1111
        /* redraw the pager_index indicator, because the
1112
         * flags for this message might have changed. */
1113
        menu_redraw_current (index);
1114
  
1115
        /* print out the index status bar */
1116
        menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
1117
   
1118
!       move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), 0);
1119
        SETCOLOR (MT_COLOR_STATUS);
1120
        BKGDSET (MT_COLOR_STATUS);
1121
!       mutt_paddstr (COLS, buffer);
1122
        SETCOLOR (MT_COLOR_NORMAL);
1123
        BKGDSET (MT_COLOR_NORMAL);
1124
      }
1125
  
1126
      redraw = 0;
1127
  
1128
      if (option(OPTBRAILLEFRIENDLY)) {
1129
--- 1796,1818 ----
1130
        /* redraw the pager_index indicator, because the
1131
         * flags for this message might have changed. */
1132
        menu_redraw_current (index);
1133
+       draw_sidebar(MENU_PAGER);
1134
  
1135
        /* print out the index status bar */
1136
        menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
1137
   
1138
!       move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), SidebarWidth);
1139
        SETCOLOR (MT_COLOR_STATUS);
1140
        BKGDSET (MT_COLOR_STATUS);
1141
!       mutt_paddstr (COLS-SidebarWidth, buffer);
1142
        SETCOLOR (MT_COLOR_NORMAL);
1143
        BKGDSET (MT_COLOR_NORMAL);
1144
      }
1145
  
1146
+     /* if we're not using the index, update every time */
1147
+     if ( index == 0 )
1148
+       draw_sidebar(MENU_PAGER);
1149
+ 
1150
      redraw = 0;
1151
  
1152
      if (option(OPTBRAILLEFRIENDLY)) {
1153
***************
1154
*** 2729,2734 ****
1155
--- 2739,2751 ----
1156
  	mutt_what_key ();
1157
  	break;
1158
  
1014
  
1159
+       case OP_SIDEBAR_SCROLL_UP:
1015
-      move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), 0);
1160
+       case OP_SIDEBAR_SCROLL_DOWN:
1016
+      move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), SidebarWidth);
1161
+       case OP_SIDEBAR_NEXT:
1017
       SETCOLOR (MT_COLOR_STATUS);
1162
+       case OP_SIDEBAR_PREV:
1018
       BKGDSET (MT_COLOR_STATUS);
1163
+ 	scroll_sidebar(ch, MENU_PAGER);
1019
-      mutt_paddstr (COLS, buffer);
1164
+  	break;
1020
+      mutt_paddstr (COLS-SidebarWidth, buffer);
1165
+ 
1021
       SETCOLOR (MT_COLOR_NORMAL);
1166
        default:
1022
       BKGDSET (MT_COLOR_NORMAL);
1167
  	ch = -1;
1023
     }
1168
  	break;
1024
 
1025
+    /* if we're not using the index, update every time */
1026
+    if ( index == 0 )
1027
+      draw_sidebar(MENU_PAGER);
1028
+
1029
     redraw = 0;
1030
 
1031
     if (option(OPTBRAILLEFRIENDLY)) {
1032
@@ -2852,6 +2861,13 @@
1033
 	mutt_what_key ();
1034
 	break;
1035
 
1036
+      case OP_SIDEBAR_SCROLL_UP:
1037
+      case OP_SIDEBAR_SCROLL_DOWN:
1038
+      case OP_SIDEBAR_NEXT:
1039
+      case OP_SIDEBAR_PREV:
1040
+	scroll_sidebar(ch, MENU_PAGER);
1041
+ 	break;
1042
+
1043
       default:
1044
 	ch = -1;
1045
 	break;
1169
*** mutt-1.5.20-orig/PATCHES	2008-11-11 13:55:46.000000000 -0600
1046
*** mutt-1.5.20-orig/PATCHES	2008-11-11 13:55:46.000000000 -0600
1170
--- mutt-1.5.20-patched/PATCHES	2009-06-19 22:20:31.000000000 -0500
1047
--- mutt-1.5.20-patched/PATCHES	2009-06-19 22:20:31.000000000 -0500
1171
***************
1048
***************
Lines 1619-1626 Link Here
1619
          FREE (&value);
1496
          FREE (&value);
1620
          return;
1497
          return;
1621
        }
1498
        }
1622
--- mutt-1.5.20-orig/compose.c.orig	2009-06-22 15:29:56.000000000 +0200
1499
--- orig/compose.c.orig	2010-09-18 13:23:18.000000000 +0200
1623
+++ mutt-1.5.20-patched/compose.c	2009-06-22 15:33:16.000000000 +0200
1500
+++ new/compose.c	2010-09-18 14:01:09.000000000 +0200
1624
@@ -80,7 +80,7 @@
1501
@@ -80,7 +80,7 @@
1625
 
1502
 
1626
 #define HDR_XOFFSET 14
1503
 #define HDR_XOFFSET 14
Lines 1630-1666 Link Here
1630
 
1507
 
1631
 static char *Prompts[] =
1508
 static char *Prompts[] =
1632
 {
1509
 {
1633
@@ -146,16 +146,16 @@
1510
@@ -143,7 +143,7 @@
1634
   if ((WithCrypto & APPLICATION_PGP) && (WithCrypto & APPLICATION_SMIME))
1511
 {
1635
   {     
1512
   int off = 0;
1636
     if (!msg->security)
1513
 
1637
-      mvaddstr (HDR_CRYPT, 0,     "    Security: ");
1514
-  mvprintw (HDR_CRYPT, 0, TITLE_FMT, "Security: ");
1638
+      mvaddstr (HDR_CRYPT, SidebarWidth,     "    Security: ");
1515
+  mvprintw (HDR_CRYPT, SidebarWidth, TITLE_FMT, "Security: ");
1639
     else if (msg->security & APPLICATION_SMIME)
1516
 
1640
-      mvaddstr (HDR_CRYPT, 0,     "      S/MIME: ");
1517
   if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0)
1641
+      mvaddstr (HDR_CRYPT, SidebarWidth,     "      S/MIME: ");
1518
   {
1642
     else if (msg->security & APPLICATION_PGP)
1519
@@ -175,7 +175,7 @@
1643
-      mvaddstr (HDR_CRYPT, 0,     "         PGP: ");
1644
+      mvaddstr (HDR_CRYPT, SidebarWidth,     "         PGP: ");
1645
   }
1520
   }
1646
   else if ((WithCrypto & APPLICATION_SMIME))
1647
-    mvaddstr (HDR_CRYPT, 0,     "      S/MIME: ");
1648
+    mvaddstr (HDR_CRYPT, SidebarWidth,     "      S/MIME: ");
1649
   else if ((WithCrypto & APPLICATION_PGP))
1650
-    mvaddstr (HDR_CRYPT, 0,     "         PGP: ");
1651
+    mvaddstr (HDR_CRYPT, SidebarWidth,     "         PGP: ");
1652
   else
1653
     return;
1654
 
1521
 
1655
@@ -179,7 +179,7 @@
1656
     }
1657
   clrtoeol ();
1522
   clrtoeol ();
1658
 
1659
-  move (HDR_CRYPTINFO, 0);
1523
-  move (HDR_CRYPTINFO, 0);
1660
+  move (HDR_CRYPTINFO, SidebarWidth);
1524
+  move (HDR_CRYPTINFO, SidebarWidth);
1661
   clrtoeol ();
1525
   clrtoeol ();
1526
 
1662
   if ((WithCrypto & APPLICATION_PGP)
1527
   if ((WithCrypto & APPLICATION_PGP)
1663
       && msg->security & APPLICATION_PGP  && msg->security & SIGN)
1664
@@ -195,7 +195,7 @@
1528
@@ -195,7 +195,7 @@
1665
       && (msg->security & ENCRYPT)
1529
       && (msg->security & ENCRYPT)
1666
       && SmimeCryptAlg
1530
       && SmimeCryptAlg
Lines 1670-1684 Link Here
1670
 		NONULL(SmimeCryptAlg));
1534
 		NONULL(SmimeCryptAlg));
1671
       off = 20;
1535
       off = 20;
1672
   }
1536
   }
1673
@@ -209,7 +209,7 @@
1674
   int c;
1675
   char *t;
1676
 
1677
-  mvaddstr (HDR_MIX, 0,     "     Mix: ");
1678
+  mvaddstr (HDR_MIX, SidebarWidth,     "     Mix: ");
1679
 
1680
   if (!chain)
1681
   {
1682
@@ -224,7 +224,7 @@
1537
@@ -224,7 +224,7 @@
1683
     if (t && t[0] == '0' && t[1] == '\0')
1538
     if (t && t[0] == '0' && t[1] == '\0')
1684
       t = "<random>";
1539
       t = "<random>";
Lines 1759-1762 Link Here
1759
+	  move (HDR_FCC, HDR_XOFFSET + SidebarWidth);
1614
+	  move (HDR_FCC, HDR_XOFFSET + SidebarWidth);
1760
 	  mutt_paddstr (W, fcc);
1615
 	  mutt_paddstr (W, fcc);
1761
 	  fccSet = 1;
1616
 	  fccSet = 1;
1762
 	}
(-)./files/patch-02 (-9 / +9 lines)
Lines 1-15 Link Here
1
--- doc/Makefile.am.orig	2009-02-06 13:25:21.000000000 +0100
1
--- doc/Makefile.am.orig	2010-09-17 16:04:58.000000000 +0200
2
+++ doc/Makefile.am	2009-02-06 13:27:06.000000000 +0100
2
+++ doc/Makefile.am	2010-09-17 16:09:09.000000000 +0200
3
@@ -44,7 +44,7 @@
3
@@ -47,7 +47,7 @@
4
 
4
 
5
 all: makedoc-all
5
 all: makedoc-all
6
 
6
 
7
-makedoc-all: mutt.1 muttrc.man manual.html stamp-doc-rc stamp-doc-chunked manual.txt
7
-makedoc-all: mutt.1 smime_keys.1 muttrc.man manual.html stamp-doc-rc stamp-doc-chunked manual.txt
8
+makedoc-all: mutt.1 muttrc.man
8
+makedoc-all: mutt.1 smime_keys.1 muttrc.man
9
 
9
 
10
 install-data-local: makedoc-all instdoc
10
 install-data-local: makedoc-all instdoc
11
 	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man1
11
 	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man1
12
@@ -66,9 +66,6 @@
12
@@ -70,9 +70,6 @@
13
 		$(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir) ; \
13
 		$(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir) ; \
14
 	done
14
 	done
15
 	-$(INSTALL) -m 644 manual.txt $(DESTDIR)$(docdir)
15
 	-$(INSTALL) -m 644 manual.txt $(DESTDIR)$(docdir)
Lines 19-32 Link Here
19
 	$(INSTALL) -m 644 Muttrc $(DESTDIR)$(sysconfdir)/Muttrc.dist
19
 	$(INSTALL) -m 644 Muttrc $(DESTDIR)$(sysconfdir)/Muttrc.dist
20
 	-if [ -f $(DESTDIR)$(pkgdatadir)/Muttrc ] ; then \
20
 	-if [ -f $(DESTDIR)$(pkgdatadir)/Muttrc ] ; then \
21
 		mv $(DESTDIR)$(pkgdatadir)/Muttrc* $(DESTDIR)$(sysconfdir) ; \
21
 		mv $(DESTDIR)$(pkgdatadir)/Muttrc* $(DESTDIR)$(sysconfdir) ; \
22
@@ -99,9 +96,7 @@
22
@@ -103,9 +100,7 @@
23
 
23
 
24
 check:
24
 check:
25
 manual.txt: manual.html
25
 manual.txt: manual.html
26
-	-LC_ALL=C lynx -dump -nolist -with_backspaces manual.html > $@ || \
26
-	-LC_ALL=C lynx -dump -nolist -with_backspaces -display_charset=us-ascii manual.html > $@ || \
27
-	LC_ALL=C w3m -dump manual.html > $@ || \
27
-	LC_ALL=C w3m -dump manual.html > $@ || \
28
-	LC_ALL=C elinks -dump -no-numbering -no-references manual.html | sed -e 's,\\001, ,g' > $@
28
-	LC_ALL=C elinks -dump -no-numbering -no-references manual.html | sed -e 's,\\001, ,g' > $@
29
+	-LC_ALL=C lynx -dump -nolist -with_backspaces manual.html > $@
29
+	-LC_ALL=C lynx -dump -nolist -with_backspaces -display_charset=us-ascii manual.html > $@
30
 
30
 
31
 Muttrc: stamp-doc-rc
31
 Muttrc: stamp-doc-rc
32
 
32
 
(-)./files/patch-buffy.c (-10 lines)
Lines 1-10 Link Here
1
--- buffy.c.orig	2009-06-02 19:16:26.000000000 +0200
2
+++ buffy.c	2010-05-18 07:41:47.000000000 +0200
3
@@ -236,7 +236,6 @@
4
     {
5
       if(*tmp)
6
       {
7
-        FREE (&((*tmp)->path));
8
         tmp1=(*tmp)->next;
9
         FREE (tmp);		/* __FREE_CHECKED__ */
10
         *tmp=tmp1;
(-)./files/patch-doc-manual.xml.head (-9 lines)
Lines 8-19 Link Here
8
 <book>
8
 <book>
9
 
9
 
10
 <bookinfo>
10
 <bookinfo>
11
@@ -7271,7 +7271,7 @@
12
 <para>
13
 The built-in SMTP support supports encryption (the <literal>smtps</literal> protocol
14
 using SSL or TLS) as well as SMTP authentication using SASL. The authentication mechanisms
15
-for SASL are specified in <link linkend="smtp-authenticators">&dollar;smtp&lowbar;authenticators</link>
16
+for SASL are specified in <literal>&dollar;smtp&lowbar;authenticators</literal>
17
 defaulting to an empty list which makes Mutt try all available methods
18
 from most-secure to least-secure.
19
 </para>
(-)./files/patch-mktemp (-12 / +19 lines)
Lines 1-15 Link Here
1
--- muttlib.c.orig	2009-02-06 13:39:51.000000000 +0100
1
--- muttlib.c.orig	2010-09-17 16:14:15.000000000 +0200
2
+++ muttlib.c	2009-02-06 13:42:35.000000000 +0100
2
+++ muttlib.c	2010-09-17 16:18:51.000000000 +0200
3
@@ -733,7 +733,11 @@
3
@@ -781,14 +781,11 @@
4
 
4
 
5
 void _mutt_mktemp (char *s, const char *src, int line)
5
 void _mutt_mktemp (char *s, size_t slen, const char *src, int line)
6
 {
6
 {
7
-  snprintf (s, _POSIX_PATH_MAX, "%s/mutt-%s-%d-%d-%d", NONULL (Tempdir), NONULL(Hostname), (int) getuid(), (int) getpid (), Counter++);
7
-  size_t n = snprintf (s, slen, "%s/mutt-%s-%d-%d-%ld%ld", NONULL (Tempdir), NONULL (Hostname),
8
+  char t[7];
8
-      (int) getuid (), (int) getpid (), random (), random ());
9
+  snprintf (t, 7, "-%05d", Counter++);
9
-  if (n >= slen)
10
+  snprintf (s, _POSIX_PATH_MAX-6, "%s/mutt-%s-XXXXXXXX", NONULL(Tempdir), NONULL(Hostname));
10
-    dprint (1, (debugfile, "%s:%d: ERROR: insufficient buffer space to hold temporary filename! slen=%zu but need %zu\n",
11
+  mktemp (s);
11
-	    src, line, slen, n));
12
+  strncat(s, t, 6);
12
-  dprint (3, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s));
13
   dprint (3, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s));
13
-  if (unlink (s) && errno != ENOENT)
14
   unlink (s);
14
-    dprint (1, (debugfile, "%s:%d: ERROR: unlink(\"%s\"): %s (errno %d)\n", src, line, s, strerror (errno), errno));
15
+   char t[7];
16
+   snprintf (t, 7, "-%05d", Counter++);
17
+   snprintf (s, _POSIX_PATH_MAX-6, "%s/mutt-%s-XXXXXXXX", NONULL(Tempdir), NONULL(Hostname));
18
+   mktemp (s);
19
+   strncat(s, t, 6);
15
 }
20
 }
21
 
22
 void mutt_free_alias (ALIAS **p)
(-)./files/patch-mutt-ssl.c (-11 lines)
Lines 1-11 Link Here
1
--- mutt_ssl.c.orig	2009-06-10 07:08:29.000000000 +0200
2
+++ mutt_ssl.c	2010-05-03 10:45:21.000000000 +0200
3
@@ -652,7 +652,7 @@
4
   char *buf = NULL;
5
   int bufsize;
6
   /* needed to get the DNS subjectAltNames: */
7
-  STACK *subj_alt_names;
8
+  STACK_OF(GENERAL_NAME) *subj_alt_names;
9
   int subj_alt_names_count;
10
   GENERAL_NAME *subj_alt_name;
11
   /* did we find a name matching hostname? */
(-)./files/patch-pgp (+134 lines)
Line 0 Link Here
1
--- crypt-gpgme.c~	2010-09-10 07:41:33.584316201 +1000
2
+++ crypt-gpgme.c	2010-09-10 08:22:32.948976728 +1000
3
@@ -2003,12 +2003,14 @@
4
   {
5
     if (!mutt_strncmp ("-----BEGIN PGP ", buf, 15))
6
     {
7
-      if (!mutt_strcmp ("MESSAGE-----\n", buf + 15))
8
+      if (!mutt_strcmp ("MESSAGE-----\n", buf + 15) ||
9
+	  !mutt_strcmp ("MESSAGE-----\r\n", buf + 15))
10
       {
11
 	enc = 1;
12
 	break;
13
       }
14
-      else if (!mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15))
15
+      else if (!mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15) ||
16
+	       !mutt_strcmp ("SIGNED MESSAGE-----\r\n", buf + 15))
17
       {
18
 	sgn = 1;
19
 	break;
20
@@ -2128,7 +2130,8 @@
21
       continue;
22
     }
23
 
24
-    if (!mutt_strcmp (buf, "-----BEGIN PGP SIGNATURE-----\n"))
25
+    if (!mutt_strcmp (buf, "-----BEGIN PGP SIGNATURE-----\n") ||
26
+	!mutt_strcmp (buf, "-----BEGIN PGP SIGNATURE-----\r\n"))
27
       break;
28
     
29
     if (armor_header)
30
@@ -2196,14 +2199,17 @@
31
           clearsign = 0;
32
           start_pos = last_pos;
33
           
34
-          if (!mutt_strcmp ("MESSAGE-----\n", buf + 15))
35
+          if (!mutt_strcmp ("MESSAGE-----\n", buf + 15) ||
36
+	      !mutt_strcmp ("MESSAGE-----\r\n", buf + 15))
37
             needpass = 1;
38
-          else if (!mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15))
39
+          else if (!mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15) ||
40
+		   !mutt_strcmp ("SIGNED MESSAGE-----\r\n", buf + 15))
41
             {
42
               clearsign = 1;
43
               needpass = 0;
44
             }
45
-          else if (!mutt_strcmp ("PUBLIC KEY BLOCK-----\n", buf + 15))
46
+          else if (!mutt_strcmp ("PUBLIC KEY BLOCK-----\n", buf + 15) ||
47
+		   !mutt_strcmp ("PUBLIC KEY BLOCK-----\r\n", buf + 15))
48
           {
49
             needpass = 0;
50
             pgp_keyblock = 1;
51
--- pgp.c~	2009-05-31 03:20:08.000000000 +1000
52
+++ pgp.c	2010-09-10 08:27:40.317064142 +1000
53
@@ -219,7 +219,8 @@
54
       continue;
55
     }
56
 
57
-    if (mutt_strcmp (buf, "-----BEGIN PGP SIGNATURE-----\n") == 0)
58
+    if (mutt_strcmp (buf, "-----BEGIN PGP SIGNATURE-----\n") == 0 ||
59
+	mutt_strcmp (buf, "-----BEGIN PGP SIGNATURE-----\r\n") == 0)
60
       break;
61
     
62
     if (armor_header)
63
@@ -287,14 +288,17 @@
64
       clearsign = 0;
65
       start_pos = last_pos;
66
 
67
-      if (mutt_strcmp ("MESSAGE-----\n", buf + 15) == 0)
68
+      if (mutt_strcmp ("MESSAGE-----\n", buf + 15) == 0 ||
69
+	  mutt_strcmp ("MESSAGE-----\r\n", buf + 15) == 0)
70
         needpass = 1;
71
-      else if (mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15) == 0)
72
+      else if (mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15) == 0 ||
73
+	       mutt_strcmp ("SIGNED MESSAGE-----\r\n", buf + 15) == 0)
74
       {
75
 	clearsign = 1;
76
         needpass = 0;
77
       }
78
-      else if (!mutt_strcmp ("PUBLIC KEY BLOCK-----\n", buf + 15))
79
+      else if (!mutt_strcmp ("PUBLIC KEY BLOCK-----\n", buf + 15) ||
80
+	       !mutt_strcmp ("PUBLIC KEY BLOCK-----\r\n", buf + 15))
81
       {
82
         needpass = 0;
83
         pgp_keyblock = 1;
84
@@ -327,10 +331,14 @@
85
 	
86
 	fputs (buf, tmpfp);
87
 
88
-	if ((needpass && mutt_strcmp ("-----END PGP MESSAGE-----\n", buf) == 0) ||
89
-	    (!needpass 
90
-             && (mutt_strcmp ("-----END PGP SIGNATURE-----\n", buf) == 0
91
-                 || mutt_strcmp ("-----END PGP PUBLIC KEY BLOCK-----\n",buf) == 0)))
92
+	if ((needpass &&
93
+	     (mutt_strcmp ("-----END PGP MESSAGE-----\n", buf) == 0 ||
94
+	      mutt_strcmp ("-----END PGP MESSAGE-----\r\n", buf) == 0)) ||
95
+	    (!needpass &&
96
+	     (mutt_strcmp ("-----END PGP SIGNATURE-----\n", buf) == 0 ||
97
+	      mutt_strcmp ("-----END PGP SIGNATURE-----\r\n", buf) == 0 ||
98
+	      mutt_strcmp ("-----END PGP PUBLIC KEY BLOCK-----\n",buf) == 0 ||
99
+	      mutt_strcmp ("-----END PGP PUBLIC KEY BLOCK-----\r\n",buf) == 0)))
100
 	  break;
101
 	/* remember optional Charset: armor header as defined by RfC4880 */
102
 	if (mutt_strncmp ("Charset: ", buf, 9) == 0)
103
@@ -554,11 +562,14 @@
104
   {
105
     if (mutt_strncmp ("-----BEGIN PGP ", buf, 15) == 0)
106
     {
107
-      if (mutt_strcmp ("MESSAGE-----\n", buf + 15) == 0)
108
+      if (mutt_strcmp ("MESSAGE-----\n", buf + 15) == 0 ||
109
+	  mutt_strcmp ("MESSAGE-----\r\n", buf + 15) == 0)
110
 	enc = 1;
111
-      else if (mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15) == 0)
112
+      else if (mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15) == 0 ||
113
+	       mutt_strcmp ("SIGNED MESSAGE-----\r\n", buf + 15) == 0)
114
 	sgn = 1;
115
-      else if (mutt_strcmp ("PUBLIC KEY BLOCK-----\n", buf + 15) == 0)
116
+      else if (mutt_strcmp ("PUBLIC KEY BLOCK-----\n", buf + 15) == 0 ||
117
+	       mutt_strcmp ("PUBLIC KEY BLOCK-----\r\n", buf + 15) == 0)
118
 	key = 1;
119
     }
120
   }
121
@@ -1067,9 +1078,11 @@
122
    */
123
   while (fgets (buffer, sizeof (buffer) - 1, pgpout) != NULL)
124
   {
125
-    if (mutt_strcmp ("-----BEGIN PGP MESSAGE-----\n", buffer) == 0)
126
+    if (mutt_strcmp ("-----BEGIN PGP MESSAGE-----\n", buffer) == 0 ||
127
+	mutt_strcmp ("-----BEGIN PGP MESSAGE-----\r\n", buffer) == 0)
128
       fputs ("-----BEGIN PGP SIGNATURE-----\n", fp);
129
-    else if (mutt_strcmp("-----END PGP MESSAGE-----\n", buffer) == 0)
130
+    else if (mutt_strcmp("-----END PGP MESSAGE-----\n", buffer) == 0 ||
131
+	     mutt_strcmp("-----END PGP MESSAGE-----\r\n", buffer) == 0)
132
       fputs ("-----END PGP SIGNATURE-----\n", fp);
133
     else
134
       fputs (buffer, fp);

Return to bug 150703