Print this page
9718 update mandoc to 1.14.4

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mandoc/mdoc_state.c
          +++ new/usr/src/cmd/mandoc/mdoc_state.c
   1      -/*      $Id: mdoc_state.c,v 1.8 2017/05/05 15:17:32 schwarze Exp $ */
        1 +/*      $Id: mdoc_state.c,v 1.9 2017/11/29 20:05:33 schwarze Exp $ */
   2    2  /*
   3    3   * Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
   4    4   *
   5    5   * Permission to use, copy, modify, and distribute this software for any
   6    6   * purpose with or without fee is hereby granted, provided that the above
   7    7   * copyright notice and this permission notice appear in all copies.
   8    8   *
   9    9   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10   10   * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11   11   * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
↓ open down ↓ 189 lines elided ↑ open up ↑
 201  201          arg = n->parent->args->argv[0].arg;
 202  202          if (arg != MDOC_Literal && arg != MDOC_Unfilled)
 203  203                  return;
 204  204  
 205  205          state_dl(mdoc, n);
 206  206  }
 207  207  
 208  208  static void
 209  209  state_bl(STATE_ARGS)
 210  210  {
      211 +        struct mdoc_arg *args;
      212 +        size_t           i;
 211  213  
 212  214          if (n->type != ROFFT_HEAD || n->parent->args == NULL)
 213  215                  return;
 214  216  
 215      -        switch(n->parent->args->argv[0].arg) {
 216      -        case MDOC_Diag:
 217      -                n->norm->Bl.type = LIST_diag;
 218      -                break;
 219      -        case MDOC_Column:
 220      -                n->norm->Bl.type = LIST_column;
 221      -                break;
 222      -        default:
 223      -                break;
      217 +        args = n->parent->args;
      218 +        for (i = 0; i < args->argc; i++) {
      219 +                switch(args->argv[i].arg) {
      220 +                case MDOC_Diag:
      221 +                        n->norm->Bl.type = LIST_diag;
      222 +                        return;
      223 +                case MDOC_Column:
      224 +                        n->norm->Bl.type = LIST_column;
      225 +                        return;
      226 +                default:
      227 +                        break;
      228 +                }
 224  229          }
 225  230  }
 226  231  
 227  232  static void
 228  233  state_dl(STATE_ARGS)
 229  234  {
 230  235  
 231  236          switch (n->type) {
 232  237          case ROFFT_HEAD:
 233  238                  mdoc->flags |= MDOC_LITERAL;
↓ open down ↓ 59 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX