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

Diff for /mandoc/mdoc_macro.c between version 1.230 and 1.231

version 1.230, 2018/12/31 04:55:46 version 1.231, 2019/01/01 07:42:04
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, 2012-2018 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2010, 2012-2019 Ingo Schwarze <schwarze@openbsd.org>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
Line 696  blk_exp_close(MACRO_PROT_ARGS)
Line 696  blk_exp_close(MACRO_PROT_ARGS)
                             "%s %s", roff_name[tok], buf + *pos);                              "%s %s", roff_name[tok], buf + *pos);
                 if (endbody == NULL && n != NULL)                  if (endbody == NULL && n != NULL)
                         rew_pending(mdoc, n);                          rew_pending(mdoc, n);
   
                   /*
                    * Restore the fill mode that was set before the display.
                    * This needs to be done here rather than during validation
                    * such that subsequent nodes get the right flags.
                    */
   
                   if (tok == MDOC_Ed && body != NULL) {
                           if (body->flags & NODE_NOFILL)
                                   mdoc->flags |= ROFF_NOFILL;
                           else
                                   mdoc->flags &= ~ROFF_NOFILL;
                   }
                 return;                  return;
         }          }
   
Line 936  in_line(MACRO_PROT_ARGS)
Line 949  in_line(MACRO_PROT_ARGS)
 static void  static void
 blk_full(MACRO_PROT_ARGS)  blk_full(MACRO_PROT_ARGS)
 {  {
         int               done, la, nl, parsed;  
         struct mdoc_arg  *arg;          struct mdoc_arg  *arg;
         struct roff_node *blk; /* Our own or a broken block. */          struct roff_node *blk; /* Our own or a broken block. */
         struct roff_node *head; /* Our own head. */          struct roff_node *head; /* Our own head. */
         struct roff_node *body; /* Our own body. */          struct roff_node *body; /* Our own body. */
         struct roff_node *n;          struct roff_node *n;
         enum margserr     ac, lac;  
         char             *p;          char             *p;
           size_t            iarg;
           int               done, la, nl, parsed;
           enum margserr     ac, lac;
   
         nl = MDOC_NEWLINE & mdoc->flags;          nl = MDOC_NEWLINE & mdoc->flags;
   
Line 1039  blk_full(MACRO_PROT_ARGS)
Line 1053  blk_full(MACRO_PROT_ARGS)
          * regular child nodes.           * regular child nodes.
          */           */
   
           if (tok == MDOC_Sh)
                   mdoc->flags &= ~ROFF_NOFILL;
   
         mdoc_argv(mdoc, line, tok, &arg, pos, buf);          mdoc_argv(mdoc, line, tok, &arg, pos, buf);
         blk = mdoc_block_alloc(mdoc, line, ppos, tok, arg);          blk = mdoc_block_alloc(mdoc, line, ppos, tok, arg);
         head = body = NULL;          head = body = NULL;
Line 1180  blk_full(MACRO_PROT_ARGS)
Line 1197  blk_full(MACRO_PROT_ARGS)
   
         rew_last(mdoc, head);          rew_last(mdoc, head);
         body = roff_body_alloc(mdoc, line, ppos, tok);          body = roff_body_alloc(mdoc, line, ppos, tok);
   
           /*
            * Set up fill mode for display blocks.
            * This needs to be done here up front rather than during
            * validation such that child nodes get the right flags.
            */
   
           if (tok == MDOC_Bd && arg != NULL) {
                   for (iarg = 0; iarg < arg->argc; iarg++) {
                           switch (arg->argv[iarg].arg) {
                           case MDOC_Unfilled:
                           case MDOC_Literal:
                                   mdoc->flags |= ROFF_NOFILL;
                                   break;
                           case MDOC_Filled:
                           case MDOC_Ragged:
                           case MDOC_Centred:
                                   mdoc->flags &= ~ROFF_NOFILL;
                                   break;
                           default:
                                   continue;
                           }
                           break;
                   }
           }
 out:  out:
         if (mdoc->flags & MDOC_FREECOL) {          if (mdoc->flags & MDOC_FREECOL) {
                 rew_last(mdoc, body);                  rew_last(mdoc, body);

Legend:
Removed from v.1.230  
changed lines
  Added in v.1.231

CVSweb