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

Diff for /mandoc/roff.c between version 1.359 and 1.362

version 1.359, 2018/12/31 08:18:12 version 1.362, 2019/02/06 17:40:13
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2010-2015, 2017-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 889  roff_node_alloc(struct roff_man *man, int line, int po
Line 889  roff_node_alloc(struct roff_man *man, int line, int po
                 n->flags |= NODE_SYNPRETTY;                  n->flags |= NODE_SYNPRETTY;
         else          else
                 n->flags &= ~NODE_SYNPRETTY;                  n->flags &= ~NODE_SYNPRETTY;
         if (man->flags & ROFF_NOFILL)          if ((man->flags & (ROFF_NOFILL | ROFF_NONOFILL)) == ROFF_NOFILL)
                 n->flags |= NODE_NOFILL;                  n->flags |= NODE_NOFILL;
         else          else
                 n->flags &= ~NODE_NOFILL;                  n->flags &= ~NODE_NOFILL;
Line 3192  roff_Dd(ROFF_ARGS)
Line 3192  roff_Dd(ROFF_ARGS)
 static int  static int
 roff_TE(ROFF_ARGS)  roff_TE(ROFF_ARGS)
 {  {
           r->man->flags &= ~ROFF_NONOFILL;
         if (r->tbl == NULL) {          if (r->tbl == NULL) {
                 mandoc_msg(MANDOCERR_BLK_NOTOPEN, ln, ppos, "TE");                  mandoc_msg(MANDOCERR_BLK_NOTOPEN, ln, ppos, "TE");
                 return ROFF_IGN;                  return ROFF_IGN;
Line 3336  roff_TS(ROFF_ARGS)
Line 3337  roff_TS(ROFF_ARGS)
                 mandoc_msg(MANDOCERR_BLK_BROKEN, ln, ppos, "TS breaks TS");                  mandoc_msg(MANDOCERR_BLK_BROKEN, ln, ppos, "TS breaks TS");
                 tbl_end(r->tbl, 0);                  tbl_end(r->tbl, 0);
         }          }
           r->man->flags |= ROFF_NONOFILL;
         r->tbl = tbl_alloc(ppos, ln, r->last_tbl);          r->tbl = tbl_alloc(ppos, ln, r->last_tbl);
         if (r->last_tbl == NULL)          if (r->last_tbl == NULL)
                 r->first_tbl = r->tbl;                  r->first_tbl = r->tbl;
Line 3863  roff_renamed(ROFF_ARGS)
Line 3865  roff_renamed(ROFF_ARGS)
         return ROFF_CONT;          return ROFF_CONT;
 }  }
   
   /*
    * Measure the length in bytes of the roff identifier at *cpp
    * and advance the pointer to the next word.
    */
 static size_t  static size_t
 roff_getname(struct roff *r, char **cpp, int ln, int pos)  roff_getname(struct roff *r, char **cpp, int ln, int pos)
 {  {
Line 3870  roff_getname(struct roff *r, char **cpp, int ln, int p
Line 3876  roff_getname(struct roff *r, char **cpp, int ln, int p
         size_t    namesz;          size_t    namesz;
   
         name = *cpp;          name = *cpp;
         if ('\0' == *name)          if (*name == '\0')
                 return 0;                  return 0;
   
         /* Read until end of name and terminate it with NUL. */          /* Advance cp to the byte after the end of the name. */
   
         for (cp = name; 1; cp++) {          for (cp = name; 1; cp++) {
                 if ('\0' == *cp || ' ' == *cp) {                  namesz = cp - name;
                         namesz = cp - name;                  if (*cp == '\0' || *cp == ' ')
                         break;                          break;
                 }                  if (*cp != '\\')
                 if ('\\' != *cp)  
                         continue;                          continue;
                 namesz = cp - name;                  if (cp[1] == '{' || cp[1] == '}')
                 if ('{' == cp[1] || '}' == cp[1])  
                         break;                          break;
                 cp++;                  if (*++cp == '\\')
                 if ('\\' == *cp)  
                         continue;                          continue;
                 mandoc_msg(MANDOCERR_NAMESC, ln, pos,                  mandoc_msg(MANDOCERR_NAMESC, ln, pos,
                     "%.*s", (int)(cp - name + 1), name);                      "%.*s", (int)(cp - name + 1), name);
Line 3894  roff_getname(struct roff *r, char **cpp, int ln, int p
Line 3898  roff_getname(struct roff *r, char **cpp, int ln, int p
         }          }
   
         /* Read past spaces. */          /* Read past spaces. */
         while (' ' == *cp)  
           while (*cp == ' ')
                 cp++;                  cp++;
   
         *cpp = cp;          *cpp = cp;

Legend:
Removed from v.1.359  
changed lines
  Added in v.1.362

CVSweb