[BACK]Return to mdoc_validate.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/mdoc_validate.c between version 1.370 and 1.371

version 1.370, 2019/03/04 11:40:09 version 1.371, 2019/03/04 13:01:57
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010-2018 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2010-2019 Ingo Schwarze <schwarze@openbsd.org>
  * Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>   * Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
Line 1898  post_sm(POST_ARGS)
Line 1898  post_sm(POST_ARGS)
 static void  static void
 post_root(POST_ARGS)  post_root(POST_ARGS)
 {  {
         const char *openbsd_arch[] = {  
                 "alpha", "amd64", "arm64", "armv7", "hppa", "i386",  
                 "landisk", "loongson", "luna88k", "macppc", "mips64",  
                 "octeon", "sgi", "socppc", "sparc64", NULL  
         };  
         const char *netbsd_arch[] = {  
                 "acorn26", "acorn32", "algor", "alpha", "amiga",  
                 "arc", "atari",  
                 "bebox", "cats", "cesfic", "cobalt", "dreamcast",  
                 "emips", "evbarm", "evbmips", "evbppc", "evbsh3", "evbsh5",  
                 "hp300", "hpcarm", "hpcmips", "hpcsh", "hppa",  
                 "i386", "ibmnws", "luna68k",  
                 "mac68k", "macppc", "mipsco", "mmeye", "mvme68k", "mvmeppc",  
                 "netwinder", "news68k", "newsmips", "next68k",  
                 "pc532", "playstation2", "pmax", "pmppc", "prep",  
                 "sandpoint", "sbmips", "sgimips", "shark",  
                 "sparc", "sparc64", "sun2", "sun3",  
                 "vax", "walnut", "x68k", "x86", "x86_64", "xen", NULL  
         };  
         const char **arches[] = { NULL, netbsd_arch, openbsd_arch };  
   
         struct roff_node *n;          struct roff_node *n;
         const char **arch;  
   
         /* Add missing prologue data. */          /* Add missing prologue data. */
   
Line 1946  post_root(POST_ARGS)
Line 1924  post_root(POST_ARGS)
                     "(OpenBSD)" : "(NetBSD)");                      "(OpenBSD)" : "(NetBSD)");
   
         if (mdoc->meta.arch != NULL &&          if (mdoc->meta.arch != NULL &&
             (arch = arches[mdoc->meta.os_e]) != NULL) {              arch_valid(mdoc->meta.arch, mdoc->meta.os_e) == 0) {
                 while (*arch != NULL && strcmp(*arch, mdoc->meta.arch))                  n = mdoc->meta.first->child;
                         arch++;                  while (n->tok != MDOC_Dt ||
                 if (*arch == NULL) {                      n->child == NULL ||
                         n = mdoc->meta.first->child;                      n->child->next == NULL ||
                         while (n->tok != MDOC_Dt ||                      n->child->next->next == NULL)
                             n->child == NULL ||                          n = n->next;
                             n->child->next == NULL ||                  n = n->child->next->next;
                             n->child->next->next == NULL)                  mandoc_msg(MANDOCERR_ARCH_BAD, n->line, n->pos,
                                 n = n->next;                      "Dt ... %s %s", mdoc->meta.arch,
                         n = n->child->next->next;                      mdoc->meta.os_e == MANDOC_OS_OPENBSD ?
                         mandoc_msg(MANDOCERR_ARCH_BAD, n->line, n->pos,                      "(OpenBSD)" : "(NetBSD)");
                             "Dt ... %s %s", mdoc->meta.arch,  
                             mdoc->meta.os_e == MANDOC_OS_OPENBSD ?  
                             "(OpenBSD)" : "(NetBSD)");  
                 }  
         }          }
   
         /* Check that we begin with a proper `Sh'. */          /* Check that we begin with a proper `Sh'. */

Legend:
Removed from v.1.370  
changed lines
  Added in v.1.371

CVSweb