pkgsrc-Changes archive

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

CVS commit: pkgsrc/textproc/mandoc



Module Name:    pkgsrc
Committed By:   wiz
Date:           Wed Jul 30 13:21:45 UTC 2025

Modified Files:
        pkgsrc/textproc/mandoc: Makefile distinfo
Added Files:
        pkgsrc/textproc/mandoc/patches: patch-tag.c

Log Message:
mandoc: merge upstream patch fixing a core dump with got(1).

With help from Ingo Schwarze.

Addresses PR 59562.

Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 pkgsrc/textproc/mandoc/Makefile
cvs rdiff -u -r1.9 -r1.10 pkgsrc/textproc/mandoc/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/textproc/mandoc/patches/patch-tag.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/textproc/mandoc/Makefile
diff -u pkgsrc/textproc/mandoc/Makefile:1.18 pkgsrc/textproc/mandoc/Makefile:1.19
--- pkgsrc/textproc/mandoc/Makefile:1.18        Fri May  9 06:27:32 2025
+++ pkgsrc/textproc/mandoc/Makefile     Wed Jul 30 13:21:45 2025
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.18 2025/05/09 06:27:32 wiz Exp $
+# $NetBSD: Makefile,v 1.19 2025/07/30 13:21:45 wiz Exp $
 
 DISTNAME=      mandoc-1.14.6
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    textproc devel
 MASTER_SITES=  http://mandoc.bsd.lv/snapshots/
 

Index: pkgsrc/textproc/mandoc/distinfo
diff -u pkgsrc/textproc/mandoc/distinfo:1.9 pkgsrc/textproc/mandoc/distinfo:1.10
--- pkgsrc/textproc/mandoc/distinfo:1.9 Fri May  9 06:27:32 2025
+++ pkgsrc/textproc/mandoc/distinfo     Wed Jul 30 13:21:45 2025
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.9 2025/05/09 06:27:32 wiz Exp $
+$NetBSD: distinfo,v 1.10 2025/07/30 13:21:45 wiz Exp $
 
 BLAKE2s (mandoc-1.14.6.tar.gz) = ec1c9fced52eb7638ccf3d39c6cbeafb9bab371cf28070738d4f30f28a69d75b
 SHA512 (mandoc-1.14.6.tar.gz) = 54286070812a47b629f68757046d3c9a1bdd2b5d1c3b84a5c8e4cb92f1331afa745443f7238175835d8cfbe5b8dd442e00c75c3a5b5b8f8efd8d2ec8f636dad4
 Size (mandoc-1.14.6.tar.gz) = 697150 bytes
 SHA1 (patch-out.c) = 10cad373e3b9af79c460637f1e0ae72a1faeb670
 SHA1 (patch-roff.7) = ac872e85109bb69911a55f82730452a6dfb34159
+SHA1 (patch-tag.c) = 6ac52578d6fd43906d64b5843ef61b8909fde73a

Added files:

Index: pkgsrc/textproc/mandoc/patches/patch-tag.c
diff -u /dev/null pkgsrc/textproc/mandoc/patches/patch-tag.c:1.1
--- /dev/null   Wed Jul 30 13:21:45 2025
+++ pkgsrc/textproc/mandoc/patches/patch-tag.c  Wed Jul 30 13:21:45 2025
@@ -0,0 +1,129 @@
+$NetBSD: patch-tag.c,v 1.1 2025/07/30 13:21:45 wiz Exp $
+
+Revisions 1.37 and 1.38 from upstream.
+
+--- tag.c.orig 2021-09-23 18:03:23.000000000 +0000
++++ tag.c
+@@ -2,3 +2,4 @@
+ /*
+- * Copyright (c) 2015,2016,2018,2019,2020 Ingo Schwarze <schwarze%openbsd.org@localhost>
++ * Copyright (c) 2015, 2016, 2018, 2019, 2020, 2022, 2023
++ *               Ingo Schwarze <schwarze%openbsd.org@localhost>
+  *
+@@ -27,2 +28,3 @@
+ #include <stdint.h>
++#include <stdio.h>
+ #include <stdlib.h>
+@@ -32,2 +34,3 @@
+ #include "mandoc_ohash.h"
++#include "mandoc.h"
+ #include "roff.h"
+@@ -82,3 +85,3 @@ tag_free(void)
+  * Set a node where a term is defined,
+- * unless it is already defined at a lower priority.
++ * unless the term is already defined at a lower priority.
+  */
+@@ -89,5 +92,7 @@ tag_put(const char *s, int prio, struct 
+       struct roff_node        *nold;
+-      const char              *se;
++      const char              *se, *src;
++      char                    *cpy;
+       size_t                   len;
+       unsigned int             slot;
++      int                      changed;
+ 
+@@ -95,2 +100,15 @@ tag_put(const char *s, int prio, struct 
+ 
++      /*
++       * If the node is already tagged, the existing tag is
++       * explicit and we are now about to add an implicit tag.
++       * Don't do that; just skip implicit tagging if the author
++       * specified an explicit tag.
++       */
++
++      if (n->flags & NODE_ID)
++              return;
++
++      /* Determine the implicit tag. */
++
++      changed = 1;
+       if (s == NULL) {
+@@ -111,3 +129,3 @@ tag_put(const char *s, int prio, struct 
+                       default:
+-                              break;
++                              return;
+                       }
+@@ -115,2 +133,3 @@ tag_put(const char *s, int prio, struct 
+               default:
++                      changed = 0;
+                       break;
+@@ -120,2 +139,3 @@ tag_put(const char *s, int prio, struct 
+       /*
++       * Translate \- and ASCII_HYPH to plain '-'.
+        * Skip whitespace and escapes and whatever follows,
+@@ -124,10 +144,34 @@ tag_put(const char *s, int prio, struct 
+ 
+-      len = strcspn(s, " \t\\");
++      cpy = mandoc_malloc(strlen(s) + 1);
++      for (src = s, len = 0; *src != '\0'; src++, len++) {
++              switch (*src) {
++              case '\t':
++              case ' ':
++                      changed = 1;
++                      break;
++              case ASCII_HYPH:
++                      cpy[len] = '-';
++                      changed = 1;
++                      continue;
++              case '\\':
++                      if (src[1] != '-')
++                              break;
++                      src++;
++                      changed = 1;
++                      /* FALLTHROUGH */
++              default:
++                      cpy[len] = *src;
++                      continue;
++              }
++              break;
++      }
+       if (len == 0)
+-              return;
++              goto out;
++      cpy[len] = '\0';
+ 
+-      se = s + len;
+-      if (*se != '\0' && prio < TAG_WEAK)
++      if (*src != '\0' && prio < TAG_WEAK)
+               prio = TAG_WEAK;
+ 
++      s = cpy;
++      se = cpy + len;
+       slot = ohash_qlookupi(&tag_data, s, &se);
+@@ -139,4 +183,3 @@ tag_put(const char *s, int prio, struct 
+               entry = mandoc_malloc(sizeof(*entry) + len + 1);
+-              memcpy(entry->s, s, len);
+-              entry->s[len] = '\0';
++              memcpy(entry->s, s, len + 1);
+               entry->nodes = NULL;
+@@ -152,3 +195,3 @@ tag_put(const char *s, int prio, struct 
+       else if (entry->prio < prio)
+-                      return;
++              goto out;
+ 
+@@ -169,3 +212,3 @@ tag_put(const char *s, int prio, struct 
+                       entry->prio = TAG_DELETE;
+-                      return;
++                      goto out;
+               }
+@@ -183,3 +226,3 @@ tag_put(const char *s, int prio, struct 
+       n->flags |= NODE_ID;
+-      if (n->child == NULL || n->child->string != s || *se != '\0') {
++      if (changed) {
+               assert(n->tag == NULL);
+@@ -187,2 +230,5 @@ tag_put(const char *s, int prio, struct 
+       }
++
++ out:
++      free(cpy);
+ }



Home | Main Index | Thread Index | Old Index