pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/textproc/groff Under Irix, vsnprintf(3) happily trunca...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5c74c6de52e8
branches:  trunk
changeset: 474966:5c74c6de52e8
user:      jschauma <jschauma%pkgsrc.org@localhost>
date:      Sat May 08 03:21:57 2004 +0000

description:
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.

diffstat:

 textproc/groff/distinfo         |   3 ++-
 textproc/groff/patches/patch-af |  22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r a8d8fd79ff67 -r 5c74c6de52e8 textproc/groff/distinfo
--- a/textproc/groff/distinfo   Sat May 08 02:50:03 2004 +0000
+++ b/textproc/groff/distinfo   Sat May 08 03:21:57 2004 +0000
@@ -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-ac) = 0bf974a050a762172cb3b43edd55159fe22c955d
 SHA1 (patch-ad) = 1ccb3038b60c9f3955c03dcdc5913c1541e41a87
 SHA1 (patch-ae) = 18d553fe99ca6915d42de5f6edf74fc56e2fc650
+SHA1 (patch-af) = 9b880e36e30c1206ff09f63f227c8621922310f9
diff -r a8d8fd79ff67 -r 5c74c6de52e8 textproc/groff/patches/patch-af
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/groff/patches/patch-af   Sat May 08 03:21:57 2004 +0000
@@ -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) {



Home | Main Index | Thread Index | Old Index