Changeset 238


Ignore:
Timestamp:
Jul 15, 2009, 8:08:00 PM (15 years ago)
Author:
katerina
Message:

Fix timezone format in email date header (ticket #158).

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/aclocal.m4

    r236 r238  
    20642064])# AC_PROG_LD_GNU
    20652065
     2066# SH_STRFTIME_Z
     2067# -------------
     2068# check whether strftime supports %z
     2069AC_DEFUN([SH_STRFTIME_Z],
     2070[
     2071AC_MSG_CHECKING([whether strftime supports %z])
     2072AC_TRY_RUN([
     2073#include <time.h>
     2074#include <string.h>
     2075int main()
     2076{
     2077   struct tm tm;
     2078   char tt[64];
     2079   memset(&tm, 0, sizeof(tm));
     2080   strftime(tt, sizeof(tt), "%z", &tm);
     2081
     2082   if (strlen(tt) != 5) return 1;
     2083   return 0;
     2084}
     2085],
     2086[
     2087AC_MSG_RESULT([yes])
     2088AC_DEFINE(HAVE_STRFTIME_Z, 1, [strftime supports %z])
     2089],
     2090[
     2091AC_MSG_RESULT([no])
     2092],[
     2093AC_MSG_RESULT([no])
     2094])])
     2095
     2096
     2097
     2098
     2099
    20662100dnl *-*wedit:notab*-*  Please keep this as the last line.
    20672101
  • trunk/configure.ac

    r235 r238  
    376376AC_CHECK_FUNCS(vsnprintf, [SL_CHECK_VSNPRINTF])
    377377AC_CHECK_MLOCK
     378SH_STRFTIME_Z
    378379
    379380AC_MSG_CHECKING(how to get filesystem type)
  • trunk/docs/Changelog

    r237 r238  
    112.5.7:
     2        * If available, use %z to print timezone as hour offset from GMT
     3          in email date headers (problem reported by NP, solution suggested
     4          by TimB).
    25        * eliminate C99-style comments (problem reported by
    36          venkat)
  • trunk/src/sh_mail.c

    r216 r238  
    12641264  my_tm   = localtime(&my_time);
    12651265#endif
     1266
     1267#if defined(HAVE_STRFTIME_Z)
     1268  (void)    strftime(my_tbuf, 127, _("%a, %d %b %Y %H:%M:%S %z"), my_tm);
     1269#else
    12661270  (void)    strftime(my_tbuf, 127, _("%a, %d %b %Y %H:%M:%S %Z"), my_tm);
     1271#endif
    12671272
    12681273  TPT(( 0, FIL__, __LINE__,  _("msg=<From: <%s>%c%cTo: <%s>%c%cDate: %s>%c%c"),
Note: See TracChangeset for help on using the changeset viewer.