|
a/src/utils/mimeparse.cpp |
|
b/src/utils/mimeparse.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: mimeparse.cpp,v 1.16 2006-11-09 08:59:40 dockes Exp $ (C) 2004 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: mimeparse.cpp,v 1.17 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
|
... |
|
... |
721 |
zonesecs = 3600 * hours;
|
721 |
zonesecs = 3600 * hours;
|
722 |
}
|
722 |
}
|
723 |
DATEDEB((stderr, "Tz: [%s] -> %d\n", it->c_str(), zonesecs));
|
723 |
DATEDEB((stderr, "Tz: [%s] -> %d\n", it->c_str(), zonesecs));
|
724 |
nozone:
|
724 |
nozone:
|
725 |
|
725 |
|
|
|
726 |
// Compute the UTC Unix time value
|
|
|
727 |
#ifndef sun
|
726 |
time_t tim = timegm(&tm);
|
728 |
time_t tim = timegm(&tm);
|
|
|
729 |
#else
|
|
|
730 |
// No timegm on Sun. Use mktime, then correct for local timezone
|
|
|
731 |
time_t tim = mktime(&tm);
|
|
|
732 |
// altzone and timezone hold the difference in seconds between UTC
|
|
|
733 |
// and local. They are negative for places east of greenwich
|
|
|
734 |
//
|
|
|
735 |
// mktime takes our buffer to be local time, so it adds timezone
|
|
|
736 |
// to the conversion result (if timezone is < 0 it's currently
|
|
|
737 |
// earlier in greenwhich).
|
|
|
738 |
//
|
|
|
739 |
// We have to substract it back (hey! hopefully! maybe we have to
|
|
|
740 |
// add it). Who can really know?
|
|
|
741 |
tim -= timezone;
|
|
|
742 |
#endif
|
|
|
743 |
|
|
|
744 |
// And add in the correction from the email's Tz
|
727 |
tim += zonesecs;
|
745 |
tim += zonesecs;
|
|
|
746 |
|
728 |
DATEDEB((stderr, "Date: %s uxtime %ld \n", ctime(&tim), tim));
|
747 |
DATEDEB((stderr, "Date: %s uxtime %ld \n", ctime(&tim), tim));
|
729 |
return tim;
|
748 |
return tim;
|
730 |
}
|
749 |
}
|
731 |
|
750 |
|
732 |
#else
|
751 |
#else
|