From 4abc697bd05ed84485d45b43fa3574d35bddcf32 Mon Sep 17 00:00:00 2001 From: jschauma Date: Sat, 8 May 2004 03:21:57 +0000 Subject: Under Irix, vsnprintf(3) happily truncates longer strings and returns the number of size. This lead to some of the commands being truncated and not executing appropriately. (The function in questions was make_message in ./src/preproc/html/pre-html.cpp.) Patch this to also behave correctly with Irix' vsnprintf(3) family. This should address PR pkg/22563. --- textproc/groff/distinfo | 3 ++- textproc/groff/patches/patch-af | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 textproc/groff/patches/patch-af (limited to 'textproc/groff') diff --git a/textproc/groff/distinfo b/textproc/groff/distinfo index 4053a5861da..f602beb819d 100644 --- a/textproc/groff/distinfo +++ b/textproc/groff/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.5 2003/07/01 10:12:54 wiz Exp $ +$NetBSD: distinfo,v 1.6 2004/05/08 03:21:57 jschauma Exp $ SHA1 (groff-1.19.tar.gz) = b045c1e9f4aafec5e52c32e04eac537952f617ca Size (groff-1.19.tar.gz) = 2416140 bytes @@ -7,3 +7,4 @@ SHA1 (patch-ab) = 96e82cde53a6f945763e88f0b163581a71dc448b SHA1 (patch-ac) = 0bf974a050a762172cb3b43edd55159fe22c955d SHA1 (patch-ad) = 1ccb3038b60c9f3955c03dcdc5913c1541e41a87 SHA1 (patch-ae) = 18d553fe99ca6915d42de5f6edf74fc56e2fc650 +SHA1 (patch-af) = 9b880e36e30c1206ff09f63f227c8621922310f9 diff --git a/textproc/groff/patches/patch-af b/textproc/groff/patches/patch-af new file mode 100644 index 00000000000..94acfca62fd --- /dev/null +++ b/textproc/groff/patches/patch-af @@ -0,0 +1,22 @@ +$NetBSD: patch-af,v 1.1 2004/05/08 03:21:57 jschauma Exp $ + +--- ./src/preproc/html/pre-html.cpp.orig Fri May 7 17:51:50 2004 ++++ ./src/preproc/html/pre-html.cpp Fri May 7 17:52:08 2004 +@@ -263,7 +263,7 @@ + n = vsnprintf (p, size, fmt, ap); + va_end(ap); + /* If that worked, return the string. */ +- if (n > -1 && n < size) { ++ if (n > -1 && n < size-1) { + if (size > n+1) { + np = strsave(p); + free(p); +@@ -272,8 +272,6 @@ + return p; + } + /* Else try again with more space. */ +- if (n > -1) /* glibc 2.1 */ +- size = n+1; /* precisely what is needed */ + else /* glibc 2.0 */ + size *= 2; /* twice the old size */ + if ((np = (char *)realloc (p, size)) == NULL) { -- cgit v1.2.3