Changeset View
Changeset View
Standalone View
Standalone View
mail/mutt/files/extra-patch-smartdate
--- hdrline.c.orig 2017-02-24 18:29:36 UTC | --- hdrline.c.orig 2017-06-03 23:31:21 UTC | ||||
+++ hdrline.c | +++ hdrline.c | ||||
@@ -248,6 +248,89 @@ static char *apply_subject_mods (ENVELOP | @@ -249,6 +249,89 @@ static char *apply_subject_mods (ENVELOP | ||||
* %Y = `x-label:' field (if present, tree unfolded, and != parent's x-label) | * %Y = `x-label:' field (if present, tree unfolded, and != parent's x-label) | ||||
* %Z = status flags */ | * %Z = status flags */ | ||||
+static void | +static void | ||||
+format_smartdate( char *buf, size_t max, struct tm *tm, smartdate_type type ) | +format_smartdate( char *buf, size_t max, struct tm *tm, smartdate_type type ) | ||||
+{ | +{ | ||||
+ char *strftime_fmt = NULL; | + char *strftime_fmt = NULL; | ||||
+ | + | ||||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | |||||
+ } | + } | ||||
+ | + | ||||
+ format_smartdate( buf, max, tm, type ); | + format_smartdate( buf, max, tm, type ); | ||||
+} | +} | ||||
+ | + | ||||
static const char * | static const char * | ||||
hdr_format_str (char *dest, | hdr_format_str (char *dest, | ||||
size_t destlen, | size_t destlen, | ||||
@@ -421,7 +504,13 @@ hdr_format_str (char *dest, | @@ -469,7 +552,13 @@ hdr_format_str (char *dest, | ||||
if (!do_locales) | if (!do_locales) | ||||
setlocale (LC_TIME, "C"); | setlocale (LC_TIME, "C"); | ||||
- strftime (buf2, sizeof (buf2), dest, tm); | - strftime (buf2, sizeof (buf2), dest, tm); | ||||
+ /* Identify the non-strftime smartdate pattern (%@) */ | + /* Identify the non-strftime smartdate pattern (%@) */ | ||||
+ if( strncmp( dest, "%@", 2 ) == 0 ) { | + if( strncmp( dest, "%@", 2 ) == 0 ) { | ||||
+ smartdate( buf2, sizeof( buf2 ), tm ); | + smartdate( buf2, sizeof( buf2 ), tm ); | ||||
+ } | + } | ||||
+ else { | + else { | ||||
+ strftime (buf2, sizeof (buf2), dest, tm); | + strftime (buf2, sizeof (buf2), dest, tm); | ||||
+ } | + } | ||||
if (!do_locales) | if (!do_locales) | ||||
setlocale (LC_TIME, ""); | setlocale (LC_TIME, ""); | ||||
--- mutt.h.orig 2017-02-24 18:29:36 UTC | --- mutt.h.orig 2017-05-30 19:27:53 UTC | ||||
+++ mutt.h | +++ mutt.h | ||||
@@ -134,6 +134,16 @@ typedef enum | @@ -134,6 +134,16 @@ typedef enum | ||||
MUTT_FORMAT_NOFILTER = (1<<7) /* do not allow filtering on this pass */ | MUTT_FORMAT_NOFILTER = (1<<7) /* do not allow filtering on this pass */ | ||||
} format_flag; | } format_flag; | ||||
+/* flags for SmartDate */ | +/* flags for SmartDate */ | ||||
+typedef enum { | +typedef enum { | ||||
+ FUTURE = 1, | + FUTURE = 1, | ||||
Show All 10 Lines |