Christian Weisgerber wrote on Sat, Apr 03, 2010 at 03:11:26AM +0200:

> games/sudoku-solver
>   sudoku-solver.6:33:2: error: too many list types
> sysutils/tabled
>   tabled.8:53:2: error: too many list types

This one looks recoverable, too.
When two list types are specified for the same list,
just use the first type, discard the second one, and warn.

Again, this ought to be reported upstream.

Kristaps, OK?


Remaining:

> textproc/sgmlformat
>   instant.1:0:1: error: document has no title/section
> x11/sclock
>   sclock.1:0:1: error: document has no title/section
> misc/omconsole
>   omconsole.1:36:5: error: requires line arguments > 0 (has 0)
> net/bluetooth-tools
>   btkey.1:123:2: error: bad child for parent context
> net/openvpn_bsdauth
>   openvpn_bsdauth.8:22:16: error: multi-line scope breaks multi-line
>   scope of Xo
> net/ipcalc
>   ipcalc.1:70:2: error: multi-line scope breaks multi-line scope of It
> sysutils/pftop
>   pftop.8:146:2: error: multi-line scope breaks multi-line scope of It
> sysutils/login_ldap
>   login_ldap.8:283:2: error: multi-line scope breaks multi-line scope of
>   It
> sysutils/login_fingerprint
>   login_fingerprint.8:72:2: error: multi-line scope breaks multi-line
>   scope of It


--- libmdoc.h   Sat Apr  3 16:11:50 2010
+++ libmdoc.h.02        Sat Apr  3 15:06:06 2010
@@ -167,6 +167,7 @@
 #define        ARGV_ARG        (1)
 #define        ARGV_WORD       (2)
 void             mdoc_argv_free(struct mdoc_arg *);
+void             mdoc_argn_free(struct mdoc_arg *, int);
 int              mdoc_args(struct mdoc *, int,
                        int *, char *, enum mdoct, char **);
 int              mdoc_zargs(struct mdoc *, int, 
--- mdoc_argv.c Sat Apr  3 16:11:51 2010
+++ mdoc_argv.c.02      Sat Apr  3 16:19:40 2010
@@ -285,7 +285,7 @@
 void
 mdoc_argv_free(struct mdoc_arg *p)
 {
-       int              i, j;
+       int              i;
 
        if (NULL == p)
                return;
@@ -297,23 +297,28 @@
        }
        assert(p->argc);
 
-       /* LINTED */
-       for (i = 0; i < (int)p->argc; i++) {
-               if (0 == p->argv[i].sz)
-                       continue;
-               if (NULL == p->argv[i].value)
-                       continue;
+       for (i = p->argc - 1; i >= 0; i--)
+               mdoc_argn_free(p, i);
 
-               /* LINTED */
-               for (j = 0; j < (int)p->argv[i].sz; j++) 
-                       if (p->argv[i].value[j])
-                               free(p->argv[i].value[j]);
+       free(p->argv);
+       free(p);
+}
 
-               free(p->argv[i].value);
+
+void
+mdoc_argn_free(struct mdoc_arg *p, int iarg)
+{
+       struct mdoc_argv *arg = &p->argv[iarg];
+       int               j;
+
+       if (arg->sz && arg->value) {
+               for (j = arg->sz - 1; j >= 0; j--) 
+                       free(arg->value[j]);
+               free(arg->value);
        }
 
-       free(p->argv);
-       free(p);
+       for (--p->argc; iarg < (int)p->argc; iarg++)
+               p->argv[iarg] = p->argv[iarg+1];
 }
 
 
--- mdoc_validate.c     Sat Apr  3 16:13:21 2010
+++ mdoc_validate.c.02  Sat Apr  3 15:31:47 2010
@@ -618,8 +618,12 @@
                case (MDOC_Inset):
                        /* FALLTHROUGH */
                case (MDOC_Column):
-                       if (type >= 0) 
-                               return(mdoc_nerr(mdoc, n, EMULTILIST));
+                       if (type >= 0) {
+                               if ( ! mdoc_nwarn(mdoc, n, EMULTILIST))
+                                       return(0);
+                               mdoc_argn_free(n->args, pos);
+                               break;
+                       }
                        type = n->args->argv[pos].arg;
                        break;
                case (MDOC_Compact):

Reply via email to