Control: retitle -1 neomutt: New upstream release (2020-05-01)

Hi!

I've mailed the maintainer the patches and a pullable repository
for the 20200313 update shortly after its release (message attached),
and haven't heard back from them.

In the mean-time I've been maintaining my own package at that same URL
<https://github.com/nabijaczleweli/neomutt.deb> ‒
based on the latest Salsa commit.

By happy coincidence, the packaging for 2020-05-01 was just about done
when I happened upon this report, and so here we are;
building it should be as straightforward as it gets.

Best,
наб
--- Begin Message ---
Dear Maintainer,

Enclosed are the patches I compiled for updating the neomutt package to
version 20200313, based on an uscan import on top of Salsa HEAD
(ea865abd9dff54a3d7a57812fabe13fc5b38395f),
in hopes of easing your work on this.

The patches are as follows:
1. Rebases patches and drops the patch picked from upstream,
   as it's present in this release;
2. Enables the new header cache compression feature with zlib;
3. Adds a build-dep on libzstd-dev and enables that same feature with
   zstd; this patch can be safely dropped if you'd prefer not to support
   zstd;
4. Cherry-picks the fix for upstream issue
   <https://github.com/neomutt/neomutt/issues/2175>
   (upstream commit a7f602f120788bb8501cba46e9de6cf9de35a742).

Should you prefer to receive these patches another way I'm of course
more than happy to do so;
they can also be found on the for-maintainer branch of
<https://github.com/nabijaczleweli/neomutt.deb>.

Best regards,
nabijaczleweli
From 980770162bbb2013fdeaa9e457d685f681acc354 Mon Sep 17 00:00:00 2001
From: nabijaczleweli <nabijaczlew...@gmail.com>
Date: Mon, 16 Mar 2020 04:07:42 +0100
Subject: [PATCH 1/4] Rebase patches, dropping merged upstream patch

---
 .../document_debian_defaults.patch            |  28 +-
 .../patches/debian-specific/neomuttrc.patch   |   9 +-
 .../debian-specific/use_usr_bin_editor.patch  |  20 +-
 debian/patches/misc/smime.rc.patch            |  10 +-
 debian/patches/series                         |   1 -
 ...01-fix-build-tests-for-32-bit-arches.patch | 254 ------------------
 6 files changed, 37 insertions(+), 285 deletions(-)
 delete mode 100644 debian/patches/upstream/0001-fix-build-tests-for-32-bit-arches.patch

diff --git a/debian/patches/debian-specific/document_debian_defaults.patch b/debian/patches/debian-specific/document_debian_defaults.patch
index 325d85810..fe3500902 100644
--- a/debian/patches/debian-specific/document_debian_defaults.patch
+++ b/debian/patches/debian-specific/document_debian_defaults.patch
@@ -5,12 +5,14 @@ Subject: document_debian_defaults
 Some customization of the option which are straying
 from the default only on Debian systems.
 ---
- init.h | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
+ mutt_config.c | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
 
---- a/init.h
-+++ b/init.h
-@@ -471,6 +471,9 @@
+diff --git a/mutt_config.c b/mutt_config.c
+index c568f93..4b42da9 100644
+--- a/mutt_config.c
++++ b/mutt_config.c
+@@ -469,6 +469,9 @@ struct ConfigDef MuttVars[] = {
    ** .pp
    ** When this variable is \fIset\fP, NeoMutt will include Delivered-To headers when
    ** bouncing messages.  Postfix users may wish to \fIunset\fP this variable.
@@ -20,7 +22,7 @@ from the default only on Debian systems.
    */
    { "braille_friendly", DT_BOOL, &C_BrailleFriendly, false },
    /*
-@@ -1568,6 +1571,9 @@
+@@ -1603,6 +1606,9 @@ struct ConfigDef MuttVars[] = {
    ** Optionally, NeoMutt can be compiled with a fixed domain name.
    ** .pp
    ** Also see $$use_domain and $$hidden_host.
@@ -30,7 +32,7 @@ from the default only on Debian systems.
    */
  #ifdef HAVE_LIBIDN
    { "idn_decode", DT_BOOL|R_MENU, &C_IdnDecode, true },
-@@ -2291,6 +2297,9 @@
+@@ -2338,6 +2344,9 @@ struct ConfigDef MuttVars[] = {
    ** system.  It is used with various sets of parameters to gather the
    ** list of known remailers, and to finally send a message through the
    ** mixmaster chain.
@@ -40,7 +42,7 @@ from the default only on Debian systems.
    */
  #endif
    { "move", DT_QUAD, &C_Move, MUTT_NO },
-@@ -4042,6 +4051,10 @@
+@@ -4096,6 +4105,10 @@ struct ConfigDef MuttVars[] = {
    ** This is a format string, see the $$smime_decrypt_command command for
    ** possible \fCprintf(3)\fP-like sequences.
    ** (S/MIME only)
@@ -51,7 +53,7 @@ from the default only on Debian systems.
    */
    { "smime_get_signer_cert_command", DT_STRING|DT_COMMAND, &C_SmimeGetSignerCertCommand, 0 },
    /*
-@@ -4335,6 +4348,9 @@
+@@ -4398,6 +4411,9 @@ struct ConfigDef MuttVars[] = {
    ** .ts
    ** set ssl_ca_certificates_file=/etc/ssl/certs/ca-certificates.crt
    ** .te
@@ -61,10 +63,10 @@ from the default only on Debian systems.
    */
  #endif /* USE_SSL_GNUTLS */
    { "ssl_ciphers", DT_STRING, &C_SslCiphers, 0 },
-@@ -4877,6 +4893,9 @@
-   ** is set to deliver directly via SMTP (see $$smtp_url), this
-   ** option does nothing: NeoMutt will never write out the "Bcc:" header
-   ** in this case.
+@@ -4948,6 +4964,9 @@ struct ConfigDef MuttVars[] = {
+   ** Note this option only affects the sending of messages.  Fcc'ed
+   ** copies of a message will always contain the ``Bcc:'' header if
+   ** one exists.
 +  ** .pp
 +  ** \fBNote:\fP On Debian systems, exim4 and postfix strip BCC headers by
 +  ** default. The above warning applies to exim3 users, see /etc/Muttrc.
diff --git a/debian/patches/debian-specific/neomuttrc.patch b/debian/patches/debian-specific/neomuttrc.patch
index ddb1b85cf..fb896a90c 100644
--- a/debian/patches/debian-specific/neomuttrc.patch
+++ b/debian/patches/debian-specific/neomuttrc.patch
@@ -1,8 +1,7 @@
 Some changes to the official documentation for neomutt.rc.
-
 --- a/doc/neomuttrc.head
 +++ b/doc/neomuttrc.head
-@@ -12,6 +12,34 @@
+@@ -12,6 +12,34 @@ unignore from: subject to cc date x-mailer x-url user-agent
  # Display the fields in this order
  hdr_order date from to cc subject
  
@@ -37,7 +36,7 @@ Some changes to the official documentation for neomutt.rc.
  # imitate the old search-body function
  macro index \eb "<search>~b " "search in message bodies"
  
-@@ -23,7 +51,7 @@
+@@ -23,7 +51,7 @@ macro index,pager,attach,compose \cb "\
  "call urlview to extract URLs out of a message"
  
  # Show documentation when pressing F1
@@ -46,7 +45,7 @@ Some changes to the official documentation for neomutt.rc.
  
  # show the incoming mailboxes list (just like "neomutt -y") and back when pressing "y"
  macro index y "<change-folder>?" "show incoming mailboxes list"
-@@ -36,7 +64,7 @@
+@@ -36,7 +64,7 @@ bind browser y exit
  # append-hook '\.gz$' "gzip --stdout              '%t' >> '%f'"
  
  # If NeoMutt is unable to determine your site's domain name correctly, you can
@@ -55,7 +54,7 @@ Some changes to the official documentation for neomutt.rc.
  #
  # set hostname=cs.hmc.edu
  
-@@ -48,6 +76,13 @@
+@@ -48,6 +76,13 @@ bind browser y exit
  # be undone with unmime_lookup.
  mime_lookup application/octet-stream
  
diff --git a/debian/patches/debian-specific/use_usr_bin_editor.patch b/debian/patches/debian-specific/use_usr_bin_editor.patch
index 0a77710fb..b3b91a284 100644
--- a/debian/patches/debian-specific/use_usr_bin_editor.patch
+++ b/debian/patches/debian-specific/use_usr_bin_editor.patch
@@ -6,13 +6,15 @@ Even if EDITOR is not set, mutt will always use /usr/bin/editor
 (which is set by update-alternatives), rather than falling back
 to vi.
 ---
- init.c | 2 +-
- init.h | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ init.c        | 2 ++
+ mutt_config.c | 2 +-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
 
+diff --git a/init.c b/init.c
+index 5c3ec1a..62b090a 100644
 --- a/init.c
 +++ b/init.c
-@@ -3050,6 +3050,8 @@
+@@ -806,6 +806,8 @@ int mutt_init(struct ConfigSet *cs, bool skip_sys_rc, struct ListHead *commands)
    const char *env_ed = mutt_str_getenv("VISUAL");
    if (!env_ed)
      env_ed = mutt_str_getenv("EDITOR");
@@ -20,10 +22,12 @@ to vi.
 +      env_ed = "/usr/bin/editor";
    if (env_ed)
    {
-     cs_str_string_set(Config, "editor", env_ed, NULL);
---- a/init.h
-+++ b/init.h
-@@ -1024,7 +1024,7 @@
+     cs_str_string_set(cs, "editor", env_ed, NULL);
+diff --git a/mutt_config.c b/mutt_config.c
+index 7037633..c568f93 100644
+--- a/mutt_config.c
++++ b/mutt_config.c
+@@ -1036,7 +1036,7 @@ struct ConfigDef MuttVars[] = {
    ** .pp
    ** This variable specifies which editor is used by NeoMutt.
    ** It defaults to the value of the \fC$$$VISUAL\fP, or \fC$$$EDITOR\fP, environment
diff --git a/debian/patches/misc/smime.rc.patch b/debian/patches/misc/smime.rc.patch
index a2c83eb89..d01c3360d 100644
--- a/debian/patches/misc/smime.rc.patch
+++ b/debian/patches/misc/smime.rc.patch
@@ -7,9 +7,11 @@ distributed by the default installation of Mutt.
 
 Signed-off-by: Matteo F. Vescovi <m...@debian.org>
 ---
- contrib/smime.rc | 19 ++++++++++---------
- 1 file changed, 10 insertions(+), 9 deletions(-)
+ contrib/smime.rc | 20 +++++++++++---------
+ 1 file changed, 11 insertions(+), 9 deletions(-)
 
+diff --git a/contrib/smime.rc b/contrib/smime.rc
+index 0450a04..5a5ff5e 100644
 --- a/contrib/smime.rc
 +++ b/contrib/smime.rc
 @@ -4,20 +4,20 @@
@@ -40,7 +42,7 @@ Signed-off-by: Matteo F. Vescovi <m...@debian.org>
  
  
  # Section A: Key Management
-@@ -47,9 +47,11 @@
+@@ -47,9 +47,11 @@ set crypt_verify_sig = yes
  # unset smime_decrypt_use_default_key
  
  # Path to a file or directory with trusted certificates
@@ -53,7 +55,7 @@ Signed-off-by: Matteo F. Vescovi <m...@debian.org>
  set smime_certificates="~/.smime/certificates"
  
  # Path to where all private keys go. (must exist!)
-@@ -94,7 +96,7 @@
+@@ -94,7 +96,7 @@ set smime_sign_command="openssl smime -sign -md %d -signer %c -inkey %k -passin
  # Section C: Incoming messages
  
  # Decrypt a message.  Output is a MIME entity.
diff --git a/debian/patches/series b/debian/patches/series
index 93d77e8d2..06cb026ad 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,3 @@
-upstream/0001-fix-build-tests-for-32-bit-arches.patch
 debian-specific/neomuttrc.patch
 debian-specific/use_usr_bin_editor.patch
 debian-specific/document_debian_defaults.patch
diff --git a/debian/patches/upstream/0001-fix-build-tests-for-32-bit-arches.patch b/debian/patches/upstream/0001-fix-build-tests-for-32-bit-arches.patch
deleted file mode 100644
index 8e8998f15..000000000
--- a/debian/patches/upstream/0001-fix-build-tests-for-32-bit-arches.patch
+++ /dev/null
@@ -1,254 +0,0 @@
-Upstream fix of build failures in 32 bit architectures.
-
-----
-From 4fee2b720436500a1cd73a37e3b50a76eafa2d90 Mon Sep 17 00:00:00 2001
-From: Richard Russon <r...@flatcap.org>
-Date: Tue, 12 Nov 2019 12:03:19 +0000
-Subject: [PATCH] fix build/tests for 32-bit arches
-
-- Force mutt_date_epoch_ms() to return a 64-bit value
-- Fix typo in test_mutt_date_gmtime()
-- Fix some string-to-number tests
----
- email/parse.c                 |  2 +-
- mutt/date.c                   |  5 +++--
- mutt/date.h                   |  3 ++-
- test/date/mutt_date_gmtime.c  |  2 +-
- test/string/mutt_str_atol.c   | 23 +++++++++++++++++++++++
- test/string/mutt_str_atoui.c  | 13 +++++++++++++
- test/string/mutt_str_atoul.c  | 19 +++++++++++++++++++
- test/string/mutt_str_atoull.c |  6 +++---
- 8 files changed, 65 insertions(+), 8 deletions(-)
-
-diff --git a/email/parse.c b/email/parse.c
-index 8acfdbc24..e1c1bb3cc 100644
---- a/email/parse.c
-+++ b/email/parse.c
-@@ -694,7 +694,7 @@ int mutt_rfc822_parse_line(struct Envelope *env, struct Email *e, char *line,
-           {
-             if (e)
-             {
--              int rc = mutt_str_atol(p, &e->content->length);
-+              int rc = mutt_str_atol(p, (long *) &e->content->length);
-               if ((rc < 0) || (e->content->length < 0))
-                 e->content->length = -1;
-               if (e->content->length > CONTENT_TOO_BIG)
-diff --git a/mutt/date.c b/mutt/date.c
-index 8fe6aca96..5baf053c9 100644
---- a/mutt/date.c
-+++ b/mutt/date.c
-@@ -29,6 +29,7 @@
- #include "config.h"
- #include <ctype.h>
- #include <stdbool.h>
-+#include <stdint.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -416,13 +417,13 @@ time_t mutt_date_epoch(void)
-  * mutt_date_epoch_ms - Return the number of milliseconds since the Unix epoch
-  * @retval ms The number of ms since the Unix epoch, or 0 on failure
-  */
--size_t mutt_date_epoch_ms(void)
-+uint64_t mutt_date_epoch_ms(void)
- {
-   struct timeval tv = { 0, 0 };
-   gettimeofday(&tv, NULL);
-   /* We assume that gettimeofday doesn't modify its first argument on failure.
-    * We also kind of assume that gettimeofday does not fail. */
--  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
-+  return (uint64_t) tv.tv_sec * 1000 + tv.tv_usec / 1000;
- }
- 
- /**
-diff --git a/mutt/date.h b/mutt/date.h
-index eb19adf3c..2f7f2bc56 100644
---- a/mutt/date.h
-+++ b/mutt/date.h
-@@ -24,6 +24,7 @@
- #define MUTT_LIB_DATE_H
- 
- #include <stdbool.h>
-+#include <stdint.h>
- #include <time.h>
- 
- /* theoretically time_t can be float but it is integer on most (if not all) systems */
-@@ -49,7 +50,7 @@ struct Tz
- time_t    mutt_date_add_timeout(time_t now, long timeout);
- int       mutt_date_check_month(const char *s);
- time_t    mutt_date_epoch(void);
--size_t    mutt_date_epoch_ms(void);
-+uint64_t  mutt_date_epoch_ms(void);
- struct tm mutt_date_gmtime(time_t t);
- bool      mutt_date_is_day_name(const char *s);
- size_t    mutt_date_localtime_format(char *buf, size_t buflen, const char *format, time_t t);
-diff --git a/test/date/mutt_date_gmtime.c b/test/date/mutt_date_gmtime.c
-index 933120eb2..95a030232 100644
---- a/test/date/mutt_date_gmtime.c
-+++ b/test/date/mutt_date_gmtime.c
-@@ -56,6 +56,6 @@ void test_mutt_date_gmtime(void)
-   {
-     TEST_CASE("Today");
-     struct tm tm = mutt_date_gmtime(MUTT_DATE_NOW);
--    TEST_CHECK(tm.tm_yday >= 119);
-+    TEST_CHECK(tm.tm_year >= 119);
-   }
- }
-diff --git a/test/string/mutt_str_atol.c b/test/string/mutt_str_atol.c
-index 8be49b2ae..9571ab835 100644
---- a/test/string/mutt_str_atol.c
-+++ b/test/string/mutt_str_atol.c
-@@ -43,9 +43,15 @@ static const struct TestValue tests[] = {
-   { " 3",                   0,  3 },
-   { " 3",                   0,  3 },
- 
-+#if (__WORDSIZE == 64)
-   { "9223372036854775805",  0,  9223372036854775805 },
-   { "9223372036854775806",  0,  9223372036854775806 },
-   { "9223372036854775807",  0,  LONG_MAX },
-+#else
-+  { "2147483645",           0,  2147483645 },
-+  { "2147483646",           0,  2147483646 },
-+  { "2147483647",           0,  LONG_MAX },
-+#endif
- 
-   { "-1",                   0,  -1 },
-   { "-2",                   0,  -2 },
-@@ -53,10 +59,17 @@ static const struct TestValue tests[] = {
-   { " -3",                  0,  -3 },
-   { " -3",                  0,  -3 },
- 
-+#if (__WORDSIZE == 64)
-   { "-9223372036854775806", 0,  -9223372036854775806 },
-   { "-9223372036854775807", 0,  -9223372036854775807 },
-   { "-9223372036854775808", 0,  LONG_MIN },
-+#else
-+  { "-2147483646",          0,  -2147483646 },
-+  { "-2147483647",          0,  -2147483647 },
-+  { "-2147483648",          0,  LONG_MIN },
-+#endif
- 
-+#if (__WORDSIZE == 64)
-   // Out of range tests
-   { "9223372036854775808",  -2, LONG_MAX },
-   { "9223372036854775809",  -2, LONG_MAX },
-@@ -65,6 +78,16 @@ static const struct TestValue tests[] = {
-   { "-9223372036854775809", -2, LONG_MIN },
-   { "-9223372036854775810", -2, LONG_MIN },
-   { "-9223372036854775811", -2, LONG_MIN },
-+#else
-+  // Out of range tests
-+  { "2147483648",           -2, LONG_MAX },
-+  { "2147483649",           -2, LONG_MAX },
-+  { "2147483650",           -2, LONG_MAX },
-+
-+  { "-2147483649",          -2, LONG_MIN },
-+  { "-2147483650",          -2, LONG_MIN },
-+  { "-2147483651",          -2, LONG_MIN },
-+#endif
- 
-   // Invalid tests
-   { "abc",                  -1, 0 },
-diff --git a/test/string/mutt_str_atoui.c b/test/string/mutt_str_atoui.c
-index ec0eb7ec7..fa79f9d83 100644
---- a/test/string/mutt_str_atoui.c
-+++ b/test/string/mutt_str_atoui.c
-@@ -24,6 +24,7 @@
- #include "acutest.h"
- #include "config.h"
- #include "mutt/mutt.h"
-+#include <limits.h>
- 
- struct TestValue
- {
-@@ -47,15 +48,27 @@ static const struct TestValue tests[] = {
-   { "4294967295",  0,    4294967295 },
- 
-   // Out of range tests
-+#if (__WORDSIZE == 64)
-   { "4294967296",  -2,   0 },
-   { "4294967297",  -2,   0 },
-   { "4294967298",  -2,   0 },
-+#else
-+  { "4294967296",  -1,   0 },
-+  { "4294967297",  -1,   0 },
-+  { "4294967298",  -1,   0 },
-+#endif
-   { "18446744073709551616", -1, 0 },
- 
-   // Invalid tests
-+#if (__WORDSIZE == 64)
-   { "-3",          -2,   0 },
-   { " -3",         -2,   0 },
-   { "  -3",        -2,   0 },
-+#else
-+  { "-3",          0,   4294967293 },
-+  { " -3",         0,   4294967293 },
-+  { "  -3",        0,   4294967293 },
-+#endif
-   { "abc",         1,    0 },
-   { "a123",        1,    0 },
-   { "a-123",       1,    0 },
-diff --git a/test/string/mutt_str_atoul.c b/test/string/mutt_str_atoul.c
-index 622508acb..aecb58f07 100644
---- a/test/string/mutt_str_atoul.c
-+++ b/test/string/mutt_str_atoul.c
-@@ -43,19 +43,38 @@ static const struct TestValue tests[] = {
-   { " 3",  0, 3 },
-   { "  3", 0, 3 },
- 
-+#if (__WORDSIZE == 64)
-   { "18446744073709551613",  0, 18446744073709551613UL },
-   { "18446744073709551614",  0, 18446744073709551614UL },
-   { "18446744073709551615",  0, 18446744073709551615UL },
-+#else
-+  { "4294967293",            0, 4294967293UL },
-+  { "4294967294",            0, 4294967294UL },
-+  { "4294967295",            0, 4294967295UL },
-+#endif
- 
-+#if (__WORDSIZE == 64)
-   // Out of range tests
-   { "18446744073709551616", -1, ULONG_MAX },
-   { "18446744073709551617", -1, ULONG_MAX },
-   { "18446744073709551618", -1, ULONG_MAX },
-+#else
-+  // Out of range tests
-+  { "4294967296",           -1, ULONG_MAX },
-+  { "4294967297",           -1, ULONG_MAX },
-+  { "4294967298",           -1, ULONG_MAX },
-+#endif
- 
-   // Invalid tests
-+#if (__WORDSIZE == 64)
-   { "-3",          0,    18446744073709551613UL },
-   { " -3",         0,    18446744073709551613UL },
-   { "  -3",        0,    18446744073709551613UL },
-+#else
-+  { "-3",          0,    4294967293UL },
-+  { " -3",         0,    4294967293UL },
-+  { "  -3",        0,    4294967293UL },
-+#endif
-   { "abc",         1,    0 },
-   { "a123",        1,    0 },
-   { "a-123",       1,    0 },
-diff --git a/test/string/mutt_str_atoull.c b/test/string/mutt_str_atoull.c
-index d685e98df..1489c965e 100644
---- a/test/string/mutt_str_atoull.c
-+++ b/test/string/mutt_str_atoull.c
-@@ -48,9 +48,9 @@ static const struct TestValue tests[] = {
-   { "18446744073709551615",  0, 18446744073709551615UL },
- 
-   // Out of range tests
--  { "18446744073709551616", -1, ULONG_MAX },
--  { "18446744073709551617", -1, ULONG_MAX },
--  { "18446744073709551618", -1, ULONG_MAX },
-+  { "18446744073709551616", -1, ULLONG_MAX },
-+  { "18446744073709551617", -1, ULLONG_MAX },
-+  { "18446744073709551618", -1, ULLONG_MAX },
- 
-   // Invalid tests
-   { "-3",          0,    18446744073709551613UL },
--- 
-2.24.0.rc1
-
-- 
2.20.1

From d9ad42b2d6aecd0a3da95556b6353b737436ac17 Mon Sep 17 00:00:00 2001
From: nabijaczleweli <nabijaczlew...@gmail.com>
Date: Mon, 16 Mar 2020 04:09:09 +0100
Subject: [PATCH 2/4] Turn on zlib header compression

---
 debian/rules | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 3453791e7..9e4fb0870 100755
--- a/debian/rules
+++ b/debian/rules
@@ -35,7 +35,8 @@ override_dh_auto_configure:
 		--idn \
 		--mixmaster \
 		--sasl \
-		--tokyocabinet
+		--tokyocabinet \
+		--zlib
 
 override_dh_auto_install:
 	dh_auto_install --destdir=debian/tmp
-- 
2.20.1

From 2c31658422cdd17c6398cb10a602c5f98b1590de Mon Sep 17 00:00:00 2001
From: nabijaczleweli <nabijaczlew...@gmail.com>
Date: Mon, 16 Mar 2020 05:03:58 +0100
Subject: [PATCH 3/4] Add libzstd-dev dev-dependency and enable zstd header
 compression

---
 debian/control | 3 ++-
 debian/rules   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/debian/control b/debian/control
index 9b66a41ac..d8cea3646 100644
--- a/debian/control
+++ b/debian/control
@@ -24,7 +24,8 @@ Build-Depends: debhelper (>= 10), dh-lua,
  pkg-config,
  w3m,
  xsltproc,
- zlib1g-dev
+ zlib1g-dev,
+ libzstd-dev
 Standards-Version: 4.1.3
 Vcs-Git: https://salsa.debian.org/mutt-team/neomutt.git
 Vcs-Browser: https://salsa.debian.org/mutt-team/neomutt
diff --git a/debian/rules b/debian/rules
index 9e4fb0870..a3f64db52 100755
--- a/debian/rules
+++ b/debian/rules
@@ -36,7 +36,8 @@ override_dh_auto_configure:
 		--mixmaster \
 		--sasl \
 		--tokyocabinet \
-		--zlib
+		--zlib \
+		--zstd
 
 override_dh_auto_install:
 	dh_auto_install --destdir=debian/tmp
-- 
2.20.1

From e986da1f1e8ed610da3fcf4f45dfaa89627c0dd3 Mon Sep 17 00:00:00 2001
From: nabijaczleweli <nabijaczlew...@gmail.com>
Date: Mon, 16 Mar 2020 23:19:02 +0100
Subject: [PATCH 4/4] Patch in upstream sidebar indent fix

Upstream issue: https://github.com/neomutt/neomutt/issues/2175
---
 debian/patches/series                         |   1 +
 .../patches/upstream/fix-sidebar-indent.patch | 103 ++++++++++++++++++
 2 files changed, 104 insertions(+)
 create mode 100644 debian/patches/upstream/fix-sidebar-indent.patch

diff --git a/debian/patches/series b/debian/patches/series
index 06cb026ad..2e4328dae 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ debian-specific/neomuttrc.patch
 debian-specific/use_usr_bin_editor.patch
 debian-specific/document_debian_defaults.patch
 misc/smime.rc.patch
+upstream/fix-sidebar-indent.patch
diff --git a/debian/patches/upstream/fix-sidebar-indent.patch b/debian/patches/upstream/fix-sidebar-indent.patch
new file mode 100644
index 000000000..d1e68592b
--- /dev/null
+++ b/debian/patches/upstream/fix-sidebar-indent.patch
@@ -0,0 +1,103 @@
+From: Richard Russon <r...@flatcap.org>
+Date: Sun, 15 Mar 2020 17:12:58 +0000
+Subject: fix sidebar indent
+
+Take care when comparing "$folder" against an IMAP Mailbox path
+(the `user@` may not be present on both sides).
+
+Fixes: #2173
+Fixes: #2175
+---
+ sidebar.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 56 insertions(+), 4 deletions(-)
+
+diff --git a/sidebar.c b/sidebar.c
+index 199fa7d..1f09433 100644
+--- a/sidebar.c
++++ b/sidebar.c
+@@ -36,6 +36,7 @@
+ #include <string.h>
+ #include "mutt/lib.h"
+ #include "config/lib.h"
++#include "email/lib.h"
+ #include "core/lib.h"
+ #include "gui/lib.h"
+ #include "sidebar.h"
+@@ -833,6 +834,48 @@ static void fill_empty_space(struct MuttWindow *win, int first_row,
+   }
+ }
+ 
++/**
++ * imap_is_prefix - Check if folder matches the beginning of mbox
++ * @param folder Folder
++ * @param mbox   Mailbox path
++ * @param plen   Prefix length
++ * @retval true If folder is the prefix of mbox
++ */
++static bool imap_is_prefix(const char *folder, const char *mbox, size_t *plen)
++{
++  struct Url *url_m = url_parse(mbox);
++  struct Url *url_f = url_parse(folder);
++
++  if (!url_m || !url_f)
++    return false;
++
++  bool rc = false;
++
++  if (mutt_str_strcasecmp(url_m->host, url_f->host) != 0)
++    goto done;
++
++  if (url_m->user && url_f->user && (mutt_str_strcasecmp(url_m->user, url_f->user) != 0))
++    goto done;
++
++  size_t mlen = mutt_str_strlen(url_m->path);
++  size_t flen = mutt_str_strlen(url_f->path);
++  if (flen > mlen)
++    goto done;
++
++  if (mutt_str_strncmp(url_m->path, url_f->path, flen) != 0)
++    goto done;
++
++  if (url_m->user && !url_f->user)
++    *plen += mutt_str_strlen(url_m->user) + 1;
++  rc = true;
++
++done:
++  url_free(&url_m);
++  url_free(&url_f);
++
++  return rc;
++}
++
+ /**
+  * draw_sidebar - Write out a list of mailboxes, in a panel
+  * @param win        Window to draw on
+@@ -915,15 +958,24 @@ static void draw_sidebar(struct MuttWindow *win, int num_rows, int num_cols, int
+     size_t maildirlen = mutt_str_strlen(C_Folder);
+     if (maildirlen && C_SidebarDelimChars &&
+         strchr(C_SidebarDelimChars, C_Folder[maildirlen - 1]))
++    {
+       maildirlen--;
++    }
+ 
+     /* check whether C_Folder is a prefix of the current folder's path */
+     bool maildir_is_prefix = false;
+-    if ((mutt_buffer_len(&m->pathbuf) > maildirlen) &&
+-        (mutt_str_strncmp(C_Folder, mailbox_path(m), maildirlen) == 0) &&
+-        C_SidebarDelimChars && strchr(C_SidebarDelimChars, mailbox_path(m)[maildirlen]))
++    if (m->magic == MUTT_IMAP)
+     {
+-      maildir_is_prefix = true;
++      maildir_is_prefix = imap_is_prefix(C_Folder, mailbox_path(m), &maildirlen);
++    }
++    else
++    {
++      if ((mutt_buffer_len(&m->pathbuf) > maildirlen) &&
++          (mutt_str_strncmp(C_Folder, mailbox_path(m), maildirlen) == 0) &&
++          C_SidebarDelimChars && strchr(C_SidebarDelimChars, mailbox_path(m)[maildirlen]))
++      {
++        maildir_is_prefix = true;
++      }
+     }
+ 
+     /* calculate depth of current folder and generate its display name with indented spaces */
-- 
2.20.1

Attachment: signature.asc
Description: PGP signature


--- End Message ---

Attachment: signature.asc
Description: PGP signature

Reply via email to