Mason Loring Bliss wrote in
<[email protected]>:
|On Mon, Aug 03, 2026 at 11:29:03PM -0500, Paul Eggert wrote:
|
|> The original bug report itself has serious bugs, but even the fixed test
|> program you supplied in
|> <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1143499#27> is \
|> wrong for
|> several reasons.
|
|The code was taken more or less directly from mailx, incidentally. Mailx
|says:
Depends on which mailx you mean, ewige Blumenkraft.
Your code is from Heirloom mailx, which is unmainted since 2008.
|int
|mkdate(FILE *fo, const char *field)
|{
| time_t t;
| struct tm *tmptr;
| int tzdiff, tzdiff_hour, tzdiff_min;
|
| time(&t);
| tzdiff = t - mktime(gmtime(&t));
| tzdiff_hour = (int)(tzdiff / 60);
| tzdiff_min = tzdiff_hour % 60;
| tzdiff_hour /= 60;
| tmptr = localtime(&t);
| if (tmptr->tm_isdst > 0)
| tzdiff_hour++;
| return fprintf(fo, "%s: %s, %02d %s %04d %02d:%02d:%02d %+05d\n",
| field,
| weekday_names[tmptr->tm_wday],
| tmptr->tm_mday, month_names[tmptr->tm_mon],
| tmptr->tm_year + 1900, tmptr->tm_hour,
| tmptr->tm_min, tmptr->tm_sec,
| tzdiff_hour * 100 + tzdiff_min);
|}
A maintained variant of Mail/mailx uses a different approach which
hopefully works (with/out .tm_gmtoff) correctly.
Must be said we have a drought here in Germany (where i live), and
never in my life i encountered so few insects as this year.
Surely also owed to water extraction mispolicies, and glyphosat
and other agriculture mispolicies, of the past. But still.
Many of the trees have already "turned off" say about 30% of
leaves, especially in the higher levels, and that where anyway
>75% of all trees are (severe) ill, anyway. (The latter number is
from my memory, which has a tendency to paint it black.) Same is
true for annual plants over the more lower sort.
Beautiful light though.
That is to say, in short, "ewige Blumenkraft", but with seeing
a police car when looking in the mirror.
(I haven't verified my claim, i cannot wrap my head around that
stuff at the moment.)
I say Ciao already here.
P.S.:
s32
mx_time_tzdiff(s64 secsepoch, struct tm const *utcp_or_nil, struct tm const
*localp_or_nil){
struct tm tmbuf[2], *tmx;
time_t t;
s32 rv;
NYD2_IN;
UNUSED(utcp_or_nil);
if(secsepoch < 0)
secsepoch = 0;
else if(utcp_or_nil == NIL || localp_or_nil == NIL){
if(sizeof(t) == 4 && secsepoch >= S32_MAX)
secsepoch = 0;
}
rv = 0;
if(localp_or_nil == NIL){
t = S(time_t,secsepoch);
if((tmx = localtime(&t)) == NIL)
goto jleave;
tmbuf[0] = *tmx;
localp_or_nil = &tmbuf[0];
}
#ifdef mx_HAVE_TM_GMTOFF
rv = localp_or_nil->tm_gmtoff;
#else
if(utcp_or_nil == NIL){
t = S(time_t,secsepoch);
if((tmx = gmtime(&t)) == NIL)
goto jleave;
tmbuf[1] = *tmx;
utcp_or_nil = &tmbuf[1];
}
rv = ((((localp_or_nil->tm_hour - utcp_or_nil->tm_hour) * 60) +
(localp_or_nil->tm_min - utcp_or_nil->tm_min)) * 60) +
(localp_or_nil->tm_sec - utcp_or_nil->tm_sec);
if((t = (localp_or_nil->tm_yday - utcp_or_nil->tm_yday)) != 0)
rv += (t == 1) ? S(s32,su_TIME_DAY_SECS) :
-S(s32,su_TIME_DAY_SECS);
#endif
jleave:
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)