tags 866366 +patch
thanks
fd852e5556dc6c9194d5e72acce734321defe2f8 from upstream's repo (branch
devel/expando, also attached) fixes this and applies cleanly on top of the
package sources (I dropped it into debian/patches/applyme and modified series
and all was well)
commit fd852e5556dc6c9194d5e72acce734321defe2f8
Author: Richard Russon <[email protected]>
Date: Thu Jun 29 13:28:58 2017 +0100
fix the padding expando '%>'
Debian BTS 866366
The non-greedy '%>' has been broken since the introduction of the
nested-if patch.
The second command should create a line of dots ending in a ']'
set index_format="%?M?collapsed%|.]&expanded?
set index_format="%?M?collapsed%>.]&expanded?
diff --git a/muttlib.c b/muttlib.c
index 40608929..8def1da0 100644
--- a/muttlib.c
+++ b/muttlib.c
@@ -1528,6 +1528,15 @@ void mutt_FormatString(char *dest, /* output buffer */
lrbalance = 1;
while ((lrbalance > 0) && (count < sizeof(ifstring)) && *src)
{
+ if ((src[0] == '%') && (src[1] == '>'))
+ {
+ /* This is a padding expando; copy two chars and carry on */
+ *cp++ = *src++;
+ *cp++ = *src++;
+ count += 2;
+ continue;
+ }
+
if (*src == '\\')
{
src++;
@@ -1557,6 +1566,15 @@ void mutt_FormatString(char *dest, /* output buffer */
count = 0;
while ((lrbalance > 0) && (count < sizeof(elsestring)) && *src)
{
+ if ((src[0] == '%') && (src[1] == '>'))
+ {
+ /* This is a padding expando; copy two chars and carry on */
+ *cp++ = *src++;
+ *cp++ = *src++;
+ count += 2;
+ continue;
+ }
+
if (*src == '\\')
{
src++;