Updated neomutt to 20161014.

2016-10-14  Richard Russon  <rich@flatcap.org>
* Features
  - sidebar: Make sure INBOX appears first in the list.
  - notmuch: Synchronise tags to flags
* Bug Fixes
  - updates when pager is open
  - crash when neither $spoolfile, $folder are set
  - forgotten-attachment: fix empty regex expression
  - status-color when pager_index_lines > 0
  - buffer underrun when no menu item is selected
  - crash handling keywords/labels
* Docs
  - update notmuch references
* Build
  - update references to 1.7.1
  - strfcpy() improvement
* Upstream
  - automatic post-release commit for mutt-1.7.1
  - Mark IMAP fast-trash'ed messages as read before copying. (see #3860)
  - Updated Czech translation.
  - Preserve forwarded attachment names in d_filename.
This commit is contained in:
wiz 2016-10-17 10:42:20 +00:00
parent c49f48e47a
commit bb9837d6f9
10 changed files with 7 additions and 330 deletions

View file

@ -1,7 +1,6 @@
# $NetBSD: Makefile,v 1.15 2016/10/10 19:26:31 wiz Exp $
# $NetBSD: Makefile,v 1.16 2016/10/17 10:42:20 wiz Exp $
DISTNAME= neomutt-20161003
PKGREVISION= 2
DISTNAME= neomutt-20161014
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_GITHUB:=neomutt/}
GITHUB_TAG= ${DISTNAME}

View file

@ -1,14 +1,6 @@
$NetBSD: distinfo,v 1.11 2016/10/10 19:26:31 wiz Exp $
$NetBSD: distinfo,v 1.12 2016/10/17 10:42:20 wiz Exp $
SHA1 (neomutt-20161003.tar.gz) = d0849c7efaa7e099b17137d8f5f90b9a201142f1
RMD160 (neomutt-20161003.tar.gz) = c69fe3dba35c3341987b6eb21b4bc0a1eb546762
SHA512 (neomutt-20161003.tar.gz) = f3b42e0bf12038bfdce20db30d2ac4ee60a4ce317894ff035a4180a53d0899936aef6f809c52ef8786eab6b247e98ae244578d00a5dafb44e04f4b3ccc84b592
Size (neomutt-20161003.tar.gz) = 2656280 bytes
SHA1 (patch-doc_manual.xml.head) = c569f4d51781ecb5e980e83e6f8cde9cdb97a189
SHA1 (patch-doc_muttrc.forgotten-attachment) = 185086380ac27b02e8f39e611d8de5461c1af8b0
SHA1 (patch-hash.c) = 63df8e500d91f0dffb24801b84dc7155539d34a5
SHA1 (patch-hash.h) = ddc94cfaeead9800f5f902de9f4255803122463d
SHA1 (patch-headers.c) = 8d985b9dfc717c5c30e9fb314c33b35d61dcaf56
SHA1 (patch-init.c) = 607da46758dcf4ee85644926f5d33f821b2f6713
SHA1 (patch-init.h) = f2cfba5e802527d546623dbf01d5f2a8b1552cf3
SHA1 (patch-send.c) = 16ed40585b04e136d96eb20e12caa2855c856b23
SHA1 (neomutt-20161014.tar.gz) = bca7cc769c93b08ba18867520ed3215c7d839b79
RMD160 (neomutt-20161014.tar.gz) = 94b6618d6652ab91da75ef5ff2500f8e7e300bc4
SHA512 (neomutt-20161014.tar.gz) = eb3bed8e5204001c8c2fcf630ee42873255b0cffdebcde392516a222e3f71ed5b4c8cee9f185d6a52a67cee8ccd38362f43b0e62158fd504215acdb782823de5
Size (neomutt-20161014.tar.gz) = 2659116 bytes

View file

@ -1,24 +0,0 @@
$NetBSD: patch-doc_manual.xml.head,v 1.1 2016/10/10 19:26:31 wiz Exp $
forgotten-attachment: fix empty regex expression
The original regex was of the form "abc(|def)" to check for both "abc"
and "abcdef". Unfortunately, the regex libraries on BSDs/MacOS don't
like this use of an empty sub-expression.
Expanding the regex to: "(abc|abcdef)" fixes the problem.
https://github.com/neomutt/neomutt/commit/3bc69ca25077b171f1ae9beee484629c5b5c6482
--- doc/manual.xml.head.orig 2016-10-03 11:27:32.000000000 +0000
+++ doc/manual.xml.head
@@ -10142,7 +10142,7 @@ set pgp_encrypt_self = &quot;no&quot;
<row>
<entry><literal>attach_keyword</literal></entry>
<entry>regular expression</entry>
- <entry><literal>\\&lt;attach(|ed|ments?)\\&gt;</literal></entry>
+ <entry><literal>\\&lt;(attach|attached|attachments?)\\&gt;</literal></entry>
</row>
<row>
<entry><literal>abort_noattach</literal></entry>

View file

@ -1,23 +0,0 @@
$NetBSD: patch-doc_muttrc.forgotten-attachment,v 1.1 2016/10/10 19:26:31 wiz Exp $
forgotten-attachment: fix empty regex expression
The original regex was of the form "abc(|def)" to check for both "abc"
and "abcdef". Unfortunately, the regex libraries on BSDs/MacOS don't
like this use of an empty sub-expression.
Expanding the regex to: "(abc|abcdef)" fixes the problem.
https://github.com/neomutt/neomutt/commit/3bc69ca25077b171f1ae9beee484629c5b5c6482
--- doc/muttrc.forgotten-attachment.orig 2016-10-03 11:27:32.000000000 +0000
+++ doc/muttrc.forgotten-attachment
@@ -16,7 +16,7 @@ set abort_noattach = no
# Search for the following regular expression in the body of the email
# English: attach, attached, attachment, attachments
-set attach_keyword = "\\<attach(|ed|ments?)\\>"
+set attach_keyword = "\\<(attach|attached|attachments?)\\>"
# Nederlands:
# set attach_keyword = "\\<(bijvoegen|bijgevoegd|bijlage|bijlagen)\\>"

View file

@ -1,28 +0,0 @@
$NetBSD: patch-hash.c,v 1.1 2016/10/06 16:27:15 wiz Exp $
Fix: crash handling keywords/labels
https://github.com/neomutt/neomutt/commit/f8160285f285c0bc3c93a2672ea1169af2f04481
--- hash.c.orig 2016-10-03 11:27:32.000000000 +0000
+++ hash.c
@@ -153,6 +153,20 @@ void *hash_find_hash (const HASH * table
return NULL;
}
+void hash_set_data (HASH *table, const char *key, void *data)
+{
+ if (!table)
+ return;
+
+ unsigned int hash = table->hash_string ((unsigned char *) key, table->nelem);
+
+ struct hash_elem *ptr = table->table[hash];
+ if (!ptr)
+ return;
+
+ ptr->data = data;
+}
+
void hash_delete_hash (HASH * table, int hash, const char *key, const void *data,
void (*destroy) (void *))
{

View file

@ -1,15 +0,0 @@
$NetBSD: patch-hash.h,v 1.1 2016/10/06 16:27:15 wiz Exp $
Fix: crash handling keywords/labels
https://github.com/neomutt/neomutt/commit/f8160285f285c0bc3c93a2672ea1169af2f04481
--- hash.h.orig 2016-10-03 11:27:32.000000000 +0000
+++ hash.h
@@ -46,6 +46,7 @@ void *hash_find_hash (const HASH * table
void hash_delete_hash (HASH * table, int hash, const char *key, const void *data,
void (*destroy) (void *));
void hash_destroy (HASH ** hash, void (*destroy) (void *));
+void hash_set_data (HASH *table, const char *key, void *data);
struct hash_walk_state {
int index;

View file

@ -1,139 +0,0 @@
$NetBSD: patch-headers.c,v 1.1 2016/10/06 16:27:15 wiz Exp $
Fix: crash handling keywords/labels
https://github.com/neomutt/neomutt/commit/f8160285f285c0bc3c93a2672ea1169af2f04481
--- headers.c.orig 2016-10-03 11:27:32.000000000 +0000
+++ headers.c
@@ -28,6 +28,11 @@
#include <string.h>
#include <ctype.h>
+/* The labels are used as keys in the Labels hash.
+ * The keys must have a longer lifespan than the hash.
+ */
+static LIST *LabelList = NULL;
+
void mutt_edit_headers (const char *editor,
const char *body,
HEADER *msg,
@@ -215,6 +220,65 @@ void mutt_edit_headers (const char *edit
}
}
+/**
+ * label_add - Add to a list of all labels
+ * @label: Label name to keep
+ *
+ * Add an item to our LIST of all labels.
+ *
+ * The keys in the Label HASH must have a longer lifespan than the HASH itself.
+ * We keep them in an (inefficient) linked list.
+ *
+ * Note: We don't check for duplicates.
+ *
+ * Returns:
+ * NULL on error
+ * LIST* new LIST item, on success
+ */
+static LIST *label_add (const char *label)
+{
+ if (!label)
+ return NULL;
+
+ LIST *n = mutt_new_list();
+
+ /* Insert our new LIST item at the front */
+ n->data = safe_strdup (label);
+ n->next = LabelList;
+ LabelList = n;
+
+ return n;
+}
+
+/**
+ * label_delete - Delete from a list of all labels
+ * @label: Label name to remove
+ *
+ * Delete an item from our LIST of all labels.
+ *
+ * The keys in the Label HASH must have a longer lifespan than the HASH itself.
+ * We keep them in an (inefficient) linked list.
+ */
+static void label_delete (const char *label)
+{
+ if (!label || !LabelList)
+ return;
+
+ LIST *l;
+ LIST **prev;
+
+ for (l = LabelList, prev = &LabelList; l; prev = &l->next, l = l->next)
+ {
+ if (mutt_strcmp (label, l->data) == 0)
+ {
+ *prev = l->next;
+ FREE(&l->data);
+ FREE(&l);
+ break;
+ }
+ }
+}
+
void mutt_label_ref_dec(ENVELOPE *env)
{
uintptr_t count;
@@ -227,14 +291,21 @@ void mutt_label_ref_dec(ENVELOPE *env)
{
if (label->data == NULL)
continue;
+
count = (uintptr_t)hash_find(Labels, label->data);
- if (count)
+ count--;
+ if (count > 0)
{
+ /* Existing label, decrease refcount */
+ hash_set_data (Labels, label->data, (void*) count);
+ }
+ else
+ {
+ /* Old label */
hash_delete(Labels, label->data, NULL, NULL);
- count--;
- if (count > 0)
- hash_insert(Labels, label->data, (void *)count, 0);
+ label_delete (label->data);
}
+
dprint(1, (debugfile, "--label %s: %d\n", label->data, count));
}
}
@@ -251,11 +322,22 @@ void mutt_label_ref_inc(ENVELOPE *env)
{
if (label->data == NULL)
continue;
- count = (uintptr_t)hash_find(Labels, label->data);
- if (count)
- hash_delete(Labels, label->data, NULL, NULL);
- count++; /* was zero if not found */
- hash_insert(Labels, label->data, (void *)count, 0);
+
+ count = (uintptr_t) hash_find(Labels, label->data);
+ count++;
+ if (count > 1)
+ {
+ /* Existing label, increase refcount */
+ hash_set_data (Labels, label->data, (void*) count);
+ }
+ else
+ {
+ /* New label */
+ const char *dup_label = safe_strdup (label->data);
+ label_add (dup_label);
+ hash_insert(Labels, dup_label, (void *) count, 0);
+ }
+
dprint(1, (debugfile, "++label %s: %d\n", label->data, count));
}
}

View file

@ -1,39 +0,0 @@
$NetBSD: patch-init.c,v 1.1 2016/10/10 19:26:31 wiz Exp $
forgotten-attachment: fix empty regex expression
The original regex was of the form "abc(|def)" to check for both "abc"
and "abcdef". Unfortunately, the regex libraries on BSDs/MacOS don't
like this use of an empty sub-expression.
Expanding the regex to: "(abc|abcdef)" fixes the problem.
https://github.com/neomutt/neomutt/commit/3bc69ca25077b171f1ae9beee484629c5b5c6482
--- init.c.orig 2016-10-03 11:27:32.000000000 +0000
+++ init.c
@@ -1704,6 +1704,7 @@ static void mutt_restore_default (struct
if (p->init)
{
+ int retval;
char *s = (char *) p->init;
pp->rx = safe_calloc (1, sizeof (regex_t));
@@ -1715,10 +1716,15 @@ static void mutt_restore_default (struct
s++;
pp->not = 1;
}
- if (REGCOMP (pp->rx, s, flags) != 0)
+ retval = REGCOMP (pp->rx, s, flags);
+ if (retval != 0)
{
+ char msgbuf[STRING];
+ regerror (retval, pp->rx, msgbuf, sizeof (msgbuf));
fprintf (stderr, _("mutt_restore_default(%s): error in regexp: %s\n"),
p->option, pp->pattern);
+ fprintf (stderr, "%s\n", msgbuf);
+ mutt_sleep (0);
FREE (&pp->pattern);
FREE (&pp->rx);
}

View file

@ -1,23 +0,0 @@
$NetBSD: patch-init.h,v 1.1 2016/10/10 19:26:31 wiz Exp $
forgotten-attachment: fix empty regex expression
The original regex was of the form "abc(|def)" to check for both "abc"
and "abcdef". Unfortunately, the regex libraries on BSDs/MacOS don't
like this use of an empty sub-expression.
Expanding the regex to: "(abc|abcdef)" fixes the problem.
https://github.com/neomutt/neomutt/commit/3bc69ca25077b171f1ae9beee484629c5b5c6482
--- init.h.orig 2016-10-03 11:27:32.000000000 +0000
+++ init.h
@@ -267,7 +267,7 @@ struct option_t MuttVars[] = {
** .pp
** For an explanation of ``soft-fill'', see the $$index_format documentation.
*/
- { "attach_keyword", DT_RX, R_NONE, UL &AttachKeyword, UL "\\<attach(|ed|ments?)\\>" },
+ { "attach_keyword", DT_RX, R_NONE, UL &AttachKeyword, UL "\\<(attach|attached|attachments?)\\>" },
/*
** .pp
** If $abort_noattach is not set to no, then the body of the message

View file

@ -1,23 +0,0 @@
$NetBSD: patch-send.c,v 1.1 2016/10/10 19:26:31 wiz Exp $
forgotten-attachment: fix empty regex expression
The original regex was of the form "abc(|def)" to check for both "abc"
and "abcdef". Unfortunately, the regex libraries on BSDs/MacOS don't
like this use of an empty sub-expression.
Expanding the regex to: "(abc|abcdef)" fixes the problem.
https://github.com/neomutt/neomutt/commit/3bc69ca25077b171f1ae9beee484629c5b5c6482
--- send.c.orig 2016-10-03 11:27:32.000000000 +0000
+++ send.c
@@ -1902,7 +1902,7 @@ main_loop:
/* if the abort is automatic, print an error message */
if (quadoption (OPT_ATTACH) == MUTT_YES)
{
- mutt_error _("Message contains text matching \"attach_keyword\". Not sending.");
+ mutt_error _("Message contains text matching \"$attach_keyword\". Not sending.");
}
goto main_loop;
}