[Midnightbsd-cvs] mports [23092] trunk/mail/mutt/files/patch-date-conditional: add missing patch

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Mar 8 00:24:06 EST 2018


Revision: 23092
          http://svnweb.midnightbsd.org/mports/?rev=23092
Author:   laffer1
Date:     2018-03-08 00:24:05 -0500 (Thu, 08 Mar 2018)
Log Message:
-----------
add missing patch

Added Paths:
-----------
    trunk/mail/mutt/files/patch-date-conditional

Added: trunk/mail/mutt/files/patch-date-conditional
===================================================================
--- trunk/mail/mutt/files/patch-date-conditional	                        (rev 0)
+++ trunk/mail/mutt/files/patch-date-conditional	2018-03-08 05:24:05 UTC (rev 23092)
@@ -0,0 +1,97 @@
+--- PATCHES.orig	2017-12-03 03:10:17 UTC
++++ PATCHES
+@@ -0,0 +1 @@
++patch-1.5.0.ats.date_conditional.1
+--- hdrline.c.orig	2017-12-03 03:10:17 UTC
++++ hdrline.c
+@@ -428,6 +428,53 @@ hdr_format_str (char *dest,
+ 	const char *cp;
+ 	struct tm *tm; 
+ 	time_t T;
++	int i = 0, invert = 0;
++
++	if (optional && (op == '[' || op == '(')) {
++	  char *is;
++	  T = time(NULL);
++	  T -= (op == '(') ? hdr->received : hdr->date_sent;
++
++	  is = (char *)prefix;
++	  if( *is == '>' ) {
++	    invert = 1;
++	    ++is;
++	  }
++
++	  while( *is && *is != '?' ) {
++	    int t = strtol (is, &is, 10);
++	    switch (*(is++)) {
++	      case '?':
++		break;
++	      case 'y':
++		t *= 365 * 24 * 60 * 60;
++		break;
++	      case 'M':
++		t *= 30 * 24 * 60 * 60;
++		break;
++	      case 'w':
++		t *= 7 * 24 * 60 * 60;
++		break;
++	      case 'd':
++		t *= 24 * 60 * 60;
++		break;
++	      case 'h':
++		t *= 60 * 60;
++		break;
++	      case 'm':
++		t *= 60;
++		break;
++	    }
++	    i += t;
++	  }
++
++	  if (i < 0)
++	    i *= -1;
++
++	  if( (T > i || T < -1*i) ^ invert )
++	    optional = 0;
++	  break;
++	}
+ 
+ 	p = dest;
+ 
+--- muttlib.c.orig	2017-12-03 03:10:17 UTC
++++ muttlib.c
+@@ -1335,7 +1335,16 @@ void mutt_FormatString (char *dest,		/* 
+       if (*src == '?')
+       {
+ 	flags |= MUTT_FORMAT_OPTIONAL;
+-	src++;
++	ch = *(++src); /* save the character to switch on */
++	cp = prefix;
++	++src;
++	count = 0;
++	while (count < sizeof (prefix) && *src != '?')
++	{
++	  *cp++ = *src++;
++	  count++;
++	}
++	*cp = 0;
+       }
+       else
+       {
+@@ -1351,12 +1360,12 @@ void mutt_FormatString (char *dest,		/* 
+ 	  count++;
+ 	}
+ 	*cp = 0;
+-      }
+ 
+-      if (!*src)
+-	break; /* bad format */
++	if (!*src)
++	  break; /* bad format */
+ 
+-      ch = *src++; /* save the character to switch on */
++	ch = *src++; /* save the character to switch on */
++      }
+ 
+       if (flags & MUTT_FORMAT_OPTIONAL)
+       {


Property changes on: trunk/mail/mutt/files/patch-date-conditional
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list