]> git.cameronkatri.com Git - mandoc.git/blobdiff - man_validate.c
Reject the escape sequences \[uD800] to \[uDFFF] in the parser.
[mandoc.git] / man_validate.c
index ef45ce218af409936d7ddb73581ce0cfc3c7d793..490c68e6d0eacc1abe5aa3c281e739ea265ee306 100644 (file)
@@ -33,6 +33,7 @@
 #include "roff.h"
 #include "man.h"
 #include "libmandoc.h"
+#include "roff_int.h"
 #include "libman.h"
 
 #define        CHKARGS   struct roff_man *man, struct roff_node *n
@@ -116,7 +117,6 @@ man_valid_post(struct roff_man *man)
                check_root(man, n);
                break;
        case ROFFT_EQN:
-               /* FALLTHROUGH */
        case ROFFT_TBL:
                break;
        default:
@@ -206,17 +206,11 @@ post_ft(CHKARGS)
        cp = n->child->string;
        switch (*cp) {
        case '1':
-               /* FALLTHROUGH */
        case '2':
-               /* FALLTHROUGH */
        case '3':
-               /* FALLTHROUGH */
        case '4':
-               /* FALLTHROUGH */
        case 'I':
-               /* FALLTHROUGH */
        case 'P':
-               /* FALLTHROUGH */
        case 'R':
                if ('\0' == cp[1])
                        ok = 1;
@@ -256,7 +250,7 @@ check_par(CHKARGS)
        switch (n->type) {
        case ROFFT_BLOCK:
                if (0 == n->body->nchild)
-                       man_node_delete(man, n);
+                       roff_node_delete(man, n);
                break;
        case ROFFT_BODY:
                if (0 == n->nchild)
@@ -284,7 +278,7 @@ post_IP(CHKARGS)
        switch (n->type) {
        case ROFFT_BLOCK:
                if (0 == n->head->nchild && 0 == n->body->nchild)
-                       man_node_delete(man, n);
+                       roff_node_delete(man, n);
                break;
        case ROFFT_BODY:
                if (0 == n->parent->head->nchild && 0 == n->nchild)
@@ -388,7 +382,7 @@ post_TH(CHKARGS)
         * Remove the `TH' node after we've processed it for our
         * meta-data.
         */
-       man_node_delete(man, man->last);
+       roff_node_delete(man, man->last);
 }
 
 static void
@@ -498,18 +492,17 @@ post_vs(CHKARGS)
 
        switch (n->parent->tok) {
        case MAN_SH:
-               /* FALLTHROUGH */
        case MAN_SS:
                mandoc_vmsg(MANDOCERR_PAR_SKIP, man->parse, n->line, n->pos,
                    "%s after %s", man_macronames[n->tok],
                    man_macronames[n->parent->tok]);
                /* FALLTHROUGH */
-       case MAN_MAX:
+       case TOKEN_NONE:
                /*
                 * Don't warn about this because it occurs in pod2man
                 * and would cause considerable (unfixable) warnage.
                 */
-               man_node_delete(man, n);
+               roff_node_delete(man, n);
                break;
        default:
                break;