Make it buildable with WITH_NNTP=yes.

Obtained from:	https://bugzilla.andrew.cmu.edu/cgi-bin/cvsweb.cgi/src/cyrus/imap/fetchnews.c.diff?r1=1.2.2.12&r2=1.2.2.13&f=u
This commit is contained in:
Hajimu UMEMOTO 2006-04-14 14:56:58 +00:00
parent 03e1a4e6bd
commit 1c12d8039c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=159492
4 changed files with 74 additions and 2 deletions

View file

@ -132,7 +132,6 @@ CONFIGURE_ARGS+=--with-bdb-incdir=${LOCALBASE}/include/db${BDB_VER} \
--with-bdb=db${BDB_SUFFIX}
.if defined(WITH_NNTP)
IGNORE= NNTP support is broken by the original distribution
CONFIGURE_ARGS+=--enable-nntp
PLIST_SUB+= NNTP=""
.else

View file

@ -0,0 +1,37 @@
Index: imap/fetchnews.c
diff -u -p imap/fetchnews.c.orig imap/fetchnews.c
--- imap/fetchnews.c.orig Wed Mar 23 09:40:11 2005
+++ imap/fetchnews.c Fri Apr 14 23:36:14 2006
@@ -60,6 +60,7 @@
#include "cyrusdb.h"
#include "exitcodes.h"
#include "global.h"
+#include "gmtoff.h"
#include "lock.h"
#include "prot.h"
#include "xmalloc.h"
@@ -388,6 +389,7 @@ int main(int argc, char *argv[])
&ctime.tm_hour, &ctime.tm_min, &ctime.tm_sec);
ctime.tm_year -= 1900;
ctime.tm_mon--;
+ ctime.tm_isdst = -1;
/* read the previous timestamp */
if (!sfile[0]) {
@@ -417,6 +419,7 @@ int main(int argc, char *argv[])
/* ask for new articles */
if (stamp) stamp -= 180; /* adjust back 3 minutes */
ptime = gmtime(&stamp);
+ ptime->tm_isdst = -1;
strftime(buf, sizeof(buf), datefmt, ptime);
prot_printf(pout, "NEWNEWS %s %s GMT\r\n", wildmat, buf);
@@ -433,7 +436,7 @@ int main(int argc, char *argv[])
We can't change this, otherwise we'd be incompatible
with an old localtime timestamp.
*/
- stamp -= timezone;
+ stamp += gmtoff_of(&ctime, stamp);
}
if (!newnews) {

View file

@ -132,7 +132,6 @@ CONFIGURE_ARGS+=--with-bdb-incdir=${LOCALBASE}/include/db${BDB_VER} \
--with-bdb=db${BDB_SUFFIX}
.if defined(WITH_NNTP)
IGNORE= NNTP support is broken by the original distribution
CONFIGURE_ARGS+=--enable-nntp
PLIST_SUB+= NNTP=""
.else

View file

@ -0,0 +1,37 @@
Index: imap/fetchnews.c
diff -u -p imap/fetchnews.c.orig imap/fetchnews.c
--- imap/fetchnews.c.orig Wed Mar 23 09:40:11 2005
+++ imap/fetchnews.c Fri Apr 14 23:36:14 2006
@@ -60,6 +60,7 @@
#include "cyrusdb.h"
#include "exitcodes.h"
#include "global.h"
+#include "gmtoff.h"
#include "lock.h"
#include "prot.h"
#include "xmalloc.h"
@@ -388,6 +389,7 @@ int main(int argc, char *argv[])
&ctime.tm_hour, &ctime.tm_min, &ctime.tm_sec);
ctime.tm_year -= 1900;
ctime.tm_mon--;
+ ctime.tm_isdst = -1;
/* read the previous timestamp */
if (!sfile[0]) {
@@ -417,6 +419,7 @@ int main(int argc, char *argv[])
/* ask for new articles */
if (stamp) stamp -= 180; /* adjust back 3 minutes */
ptime = gmtime(&stamp);
+ ptime->tm_isdst = -1;
strftime(buf, sizeof(buf), datefmt, ptime);
prot_printf(pout, "NEWNEWS %s %s GMT\r\n", wildmat, buf);
@@ -433,7 +436,7 @@ int main(int argc, char *argv[])
We can't change this, otherwise we'd be incompatible
with an old localtime timestamp.
*/
- stamp -= timezone;
+ stamp += gmtoff_of(&ctime, stamp);
}
if (!newnews) {