Print this page
9718 update mandoc to 1.14.4

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mandoc/man_validate.c
          +++ new/usr/src/cmd/mandoc/man_validate.c
   1    1  /*      $OpenBSD$ */
   2    2  /*
   3    3   * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
   4      - * Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
        4 + * Copyright (c) 2010, 2012-2018 Ingo Schwarze <schwarze@openbsd.org>
   5    5   *
   6    6   * Permission to use, copy, modify, and distribute this software for any
   7    7   * purpose with or without fee is hereby granted, provided that the above
   8    8   * copyright notice and this permission notice appear in all copies.
   9    9   *
  10   10   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
  11   11   * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  12   12   * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
  13   13   * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  14   14   * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
↓ open down ↓ 98 lines elided ↑ open up ↑
 113  113  
 114  114          man->last = n;
 115  115          man->next = ROFF_NEXT_SIBLING;
 116  116          switch (n->type) {
 117  117          case ROFFT_TEXT:
 118  118                  check_text(man, n);
 119  119                  break;
 120  120          case ROFFT_ROOT:
 121  121                  check_root(man, n);
 122  122                  break;
      123 +        case ROFFT_COMMENT:
 123  124          case ROFFT_EQN:
 124  125          case ROFFT_TBL:
 125  126                  break;
 126  127          default:
 127  128                  if (n->tok < ROFF_MAX) {
 128  129                          switch (n->tok) {
 129  130                          case ROFF_br:
 130  131                          case ROFF_sp:
 131  132                                  post_vs(man, n);
 132  133                                  break;
↓ open down ↓ 9 lines elided ↑ open up ↑
 142  143                          (*cp)(man, n);
 143  144                  if (man->last == n)
 144  145                          man_state(man, n);
 145  146                  break;
 146  147          }
 147  148  }
 148  149  
 149  150  static void
 150  151  check_root(CHKARGS)
 151  152  {
 152      -
 153  153          assert((man->flags & (MAN_BLINE | MAN_ELINE)) == 0);
 154  154  
 155      -        if (NULL == man->first->child)
      155 +        if (n->last == NULL || n->last->type == ROFFT_COMMENT)
 156  156                  mandoc_msg(MANDOCERR_DOC_EMPTY, man->parse,
 157  157                      n->line, n->pos, NULL);
 158  158          else
 159  159                  man->meta.hasbody = 1;
 160  160  
 161  161          if (NULL == man->meta.title) {
 162  162                  mandoc_msg(MANDOCERR_TH_NOTITLE, man->parse,
 163  163                      n->line, n->pos, NULL);
 164  164  
 165  165                  /*
↓ open down ↓ 329 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX