diff options
author | sumikawa <sumikawa@FreeBSD.org> | 2000-01-26 06:01:31 +0800 |
---|---|---|
committer | sumikawa <sumikawa@FreeBSD.org> | 2000-01-26 06:01:31 +0800 |
commit | 1241f4060ffc58fc021ec386c74a697af22c2152 (patch) | |
tree | 1428e06a3bb1727a9619313fea5f79b94e0cbe81 /japanese/mnews | |
parent | 8c997cb0b147b5da86d156f17d469081d0bae5e6 (diff) | |
download | freebsd-ports-gnome-1241f4060ffc58fc021ec386c74a697af22c2152.tar.gz freebsd-ports-gnome-1241f4060ffc58fc021ec386c74a697af22c2152.tar.zst freebsd-ports-gnome-1241f4060ffc58fc021ec386c74a697af22c2152.zip |
- use ${OSVERSION} instead of ${USE_INET6}
- fix memoly leak when using getaddrinfo()
- support draft-ietf-drums-msg-fmt-07
Partly submitted by: Hideaki YOSHIFUJI <yoshfuji@ecei.tohoku.ac.jp>
Approved by: maintainer
Diffstat (limited to 'japanese/mnews')
-rw-r--r-- | japanese/mnews/Makefile | 11 | ||||
-rw-r--r-- | japanese/mnews/files/patch-aa | 57 | ||||
-rw-r--r-- | japanese/mnews/files/patch-ab | 42 |
3 files changed, 106 insertions, 4 deletions
diff --git a/japanese/mnews/Makefile b/japanese/mnews/Makefile index 08490145d11f..bb730961bd78 100644 --- a/japanese/mnews/Makefile +++ b/japanese/mnews/Makefile @@ -14,9 +14,6 @@ MASTER_SITES= ftp://ftp.leo.chubu.ac.jp/pub/network/mnews/ MAINTAINER= seiken@ARGV.AC WRKSRC= ${WRKDIR}/mnews-1.22/build -.ifdef (USE_INET6) -MAKE_ENV = USE_INET6=1 -.endif MAN1= mnews.1 MANLANG= ja @@ -28,6 +25,12 @@ SAMPLES= _mnews.smp jnames.fj jnames.jp jnames.smp jnames.tnn GNSPOOL?= 0 IMPUT?= 0 +.include <bsd.port.pre.mk> + +.if ${OSVERSION} >= 400014 +MAKE_ENV+= USE_INET6=yes +.endif + do-configure: .for f in Makefile site_dep.h ${SED} -e s+@PREFIX@+${PREFIX}+ \ @@ -72,4 +75,4 @@ post-install: @${ECHO} "Please refer to the files in:" @${ECHO} "${PREFIX}/share/doc/mnews & ${PREFIX}/share/examples/mnews." -.include <bsd.port.mk> +.include <bsd.port.post.mk> diff --git a/japanese/mnews/files/patch-aa b/japanese/mnews/files/patch-aa new file mode 100644 index 000000000000..77b487eb86e5 --- /dev/null +++ b/japanese/mnews/files/patch-aa @@ -0,0 +1,57 @@ +--- ../tcplib/tcplib.c.orig Fri Dec 17 02:27:36 1999 ++++ ../tcplib/tcplib.c Sun Jan 16 07:37:37 2000 +@@ -12,7 +12,7 @@ + * Last Edit : 1999-12/17 + * Author : MSRS3 宅間 顯 + * +- * IPv6 support: 1999-11/19,22,30 by H.YOSHIFUJI ++ * IPv6 support: 1999-11/19,22,30, 12/04,16,24 by H.YOSHIFUJI + */ + + #include "compat.h" +@@ -229,6 +229,7 @@ + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; ++ res = res0 = NULL; + gaierr = getaddrinfo(server_name, serv_buff, &hints, &res0); + if (gaierr) { + if ((gaierr == EAI_SERVICE) && +@@ -829,8 +830,7 @@ + *port++ = '\0'; + } + #ifdef INET6 +- strncpy(hostport, host, sizeof(hostport)); +- hostport[sizeof(hostport) - 1] = '\0'; ++ strcpy(hostport, host); /* ok: strlen(hostport)+1 >= strlen(host)+1 */ + #endif /* INET6 */ + return(port); + } +@@ -862,7 +862,7 @@ + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_CANONNAME; +- ++ res0 = NULL; + if (getaddrinfo(host, NULL, &hints, &res0) == 0) { + s = res0->ai_canonname; + } +@@ -876,12 +876,16 @@ + if (canonname != (char*)NULL) { + t = strncpy(canonname, s, length); + } else { ++#ifdef DONT_HAVE_STRDUP ++ if (t = (s != (char *)NULL) ? ((char *)malloc(strlen(s)+1)) : (char *)NULL) strcpy(t,s); ++#else + t = strdup(s); ++#endif + } ++ } + #ifdef INET6 +- freeaddrinfo(res0); ++ if(res0) freeaddrinfo(res0); + #endif /* INET6 */ +- } + return(t); + } + diff --git a/japanese/mnews/files/patch-ab b/japanese/mnews/files/patch-ab new file mode 100644 index 000000000000..01554ed702c8 --- /dev/null +++ b/japanese/mnews/files/patch-ab @@ -0,0 +1,42 @@ +--- ../src/mnews.c.orig Wed Dec 15 00:29:56 1999 ++++ ../src/mnews.c Sun Jan 16 07:37:37 2000 +@@ -2870,8 +2870,17 @@ + } + dates = next_param(dates); + *year = atoi(dates); /* 年 */ +- if ((*year > 0) && (*year < 1000)) { +- *year += 1900; ++ if ((*year >= 0) && (*year < 1000)){ ++#ifdef Y2K_DONT_CONVERT_YEAR_00XX ++ for (i = 0; i < 5; i++) ++ if (dates[i] == '\0' || !isdigit(dates[i])) break; ++ if (i < 4){ ++#endif ++ /* [Y2K] 1〜3桁年表示日付変換 */ ++ *year += (*year < 50) ? 2000 : 1900; /* draft-ietf-drums-msg-fmt-07 */ ++#ifdef Y2K_DONT_CONVERT_YEAR_00XX ++ } ++#endif + } + dates = next_param(dates); + } else { /* Date, Day Month Year Time Zone */ +@@ -2885,8 +2894,17 @@ + } + dates = next_param(dates); + *year = atoi(dates); /* 年 */ +- if ((*year > 0) && (*year < 1000)) { +- *year += 1900; ++ if ((*year >= 0) && (*year < 1000)){ ++#ifdef Y2K_DONT_CONVERT_YEAR_00XX ++ for (i = 0; i < 5; i++) ++ if (dates[i] == '\0' || !isdigit(dates[i])) break; ++ if (i < 4){ ++#endif ++ /* [Y2K] 1〜3桁年表示日付変換 */ ++ *year += (*year < 50) ? 2000 : 1900; /* draft-ietf-drums-msg-fmt-07 */ ++#ifdef Y2K_DONT_CONVERT_YEAR_00XX ++ } ++#endif + } + dates = next_param(dates); + *hour = atoi(dates); /* 時 */ |