summaryrefslogtreecommitdiffstats
path: root/hdrline.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2016-08-22 20:04:52 -0700
committerKevin McCarthy <kevin@8t8.us>2016-08-22 20:04:52 -0700
commitdeb6db771f8b7991e9942ab54118e07c9e00c5e3 (patch)
tree58871934cb6e0d9689a3f4b00ba0316efb8b83c7 /hdrline.c
parent6fd899ea7d98ebb74ccbea7283987ad090e11bd7 (diff)
Remove the $locale configuration variable.
$locale was only used to set the LC_TIME locale. Unfortunately, Mutt previously defaulted to using "C". This overrode the user's locale setting and forced them to re-specify their locale inside their .muttrc. Remove $locale and instead use the locale specified by the environment. Mutt still allows "C locale" dates by using a leading "!" in $date_format, ${}, etc. Another use of $locale was to customize attribution dates using hooks. The next commit will introduce $attribution_locale, which can be used for this instead. Thanks to Derek Martin for the original patch!
Diffstat (limited to 'hdrline.c')
-rw-r--r--hdrline.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/hdrline.c b/hdrline.c
index eef19e6c..2d44de34 100644
--- a/hdrline.c
+++ b/hdrline.c
@@ -383,9 +383,6 @@ hdr_format_str (char *dest,
}
*p = 0;
- if (do_locales && Locale)
- setlocale (LC_TIME, Locale);
-
if (op == '[' || op == 'D')
tm = localtime (&hdr->date_sent);
else if (op == '(')
@@ -406,10 +403,11 @@ hdr_format_str (char *dest,
tm = gmtime (&T);
}
- strftime (buf2, sizeof (buf2), dest, tm);
-
- if (do_locales)
- setlocale (LC_TIME, "C");
+ if (!do_locales)
+ setlocale (LC_TIME, "C");
+ strftime (buf2, sizeof (buf2), dest, tm);
+ if (!do_locales)
+ setlocale (LC_TIME, "");
mutt_format_s (dest, destlen, prefix, buf2);
if (len > 0 && op != 'd' && op != 'D') /* Skip ending op */