Index | Thread | Search

From:
Steffen Nurpmeso <steffen@sdaoden.eu>
Subject:
Re: mail(1) patches (UPDATE)
To:
tech@openbsd.org
Date:
Wed, 07 Aug 2024 00:21:24 +0200

Download raw body.

Thread
Walter Alejandro Iglesias wrote in
 <ZrHIq1I-Ex-1OYrE@chancha.roquesor.com>:

Btw for my Mail clone i have

  FL int
  mx_sendout_header_date(FILE *fo, char const *field, boole must_locale){
     int tzdiff_hour, tzdiff_min, rv;
     char const *tzsign;
     struct tm *tmptr;
     NYD2_IN;

     tmptr = &mx_time_current.tc_local;

     /* */
     tzsign = n_hy;
     if(LIKELY(tmptr->tm_sec == mx_time_current.tc_gm.tm_sec) || must_locale){
        tzdiff_min = S(int,mx_time_tzdiff(mx_time_current.tc_time, NIL, tmptr));
        tzdiff_min /= su_TIME_MIN_SECS;
        tzdiff_hour = tzdiff_min / su_TIME_HOUR_MINS;
        tzdiff_min %= su_TIME_HOUR_MINS;
        tzdiff_hour *= 100;
        tzdiff_hour += tzdiff_min;
        if(tzdiff_hour < 0)
           tzdiff_hour = -tzdiff_hour;
        else
           tzsign = "+";
     }else{
        static boole a_noted;

        if(!a_noted){
           a_noted = TRU1;
           n_err(_("The difference of UTC to local timezone $TZ requires second precision.\n"
              "  Unsupported by RFC 5321, henceforth using TZ=UTC to not loose precision!\n"));
        }
        tmptr = &mx_time_current.tc_gm;
        tzdiff_hour = 0;
     }

     rv = fprintf(fo, "%s: %s, %02d %s %04d %02d:%02d:%02d %s%04d\n",
           field,
           su_time_weekday_names_abbrev[tmptr->tm_wday],
           tmptr->tm_mday,
           su_time_month_names_abbrev[tmptr->tm_mon],
           tmptr->tm_year + 1900,
           tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec,
           tzsign, tzdiff_hour);
     if(rv < 0)
        rv = -1;

     NYD2_OU;
     return rv;
  }

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
|
| Only during dog days:
| On the 81st anniversary of the Goebbel's Sportpalast speech
| von der Leyen gave an overlong hypocritical inauguration one.
| The brew's essence of our civilizing advancement seems o be:
|   Total war - shortest war -> Permanent war - everlasting war