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

Diff for /mandoc/term_ascii.c between version 1.65 and 1.69

version 1.65, 2020/09/06 14:45:22 version 1.69, 2023/11/13 19:13:01
Line 72  ascii_init(enum termenc enc, const struct manoutput *o
Line 72  ascii_init(enum termenc enc, const struct manoutput *o
         p->maxtcol = 1;          p->maxtcol = 1;
   
         p->line = 1;          p->line = 1;
           p->defindent = 5;
         p->defrmargin = p->lastrmargin = 78;          p->defrmargin = p->lastrmargin = 78;
         p->fontq = mandoc_reallocarray(NULL,          p->fontq = mandoc_reallocarray(NULL,
              (p->fontsz = 8), sizeof(*p->fontq));               (p->fontsz = 8), sizeof(*p->fontq));
Line 122  ascii_init(enum termenc enc, const struct manoutput *o
Line 123  ascii_init(enum termenc enc, const struct manoutput *o
         }          }
 #endif  #endif
   
         if (outopts->mdoc) {          if (outopts->mdoc)
                 p->mdocstyle = 1;                  p->mdocstyle = 1;
                 p->defindent = 5;  
         }  
         if (outopts->indent)          if (outopts->indent)
                 p->defindent = outopts->indent;                  p->defindent = outopts->indent;
         if (outopts->width)          if (outopts->width)
Line 196  terminal_sepline(void *arg)
Line 195  terminal_sepline(void *arg)
 static size_t  static size_t
 ascii_width(const struct termp *p, int c)  ascii_width(const struct termp *p, int c)
 {  {
         return c != ASCII_BREAK;          return c != ASCII_BREAK && c != ASCII_NBRZW && c != ASCII_TABREF;
 }  }
   
 void  void
Line 245  ascii_advance(struct termp *p, size_t len)
Line 244  ascii_advance(struct termp *p, size_t len)
 {  {
         size_t          i;          size_t          i;
   
         assert(len < UINT16_MAX);          /*
            * XXX We used to have "assert(len < UINT16_MAX)" here.
            * that is not quite right because the input document
            * can trigger that by merely providing large input.
            * For now, simply truncate.
            */
           if (len > 256)
                   len = 256;
         for (i = 0; i < len; i++)          for (i = 0; i < len; i++)
                 putchar(' ');                  putchar(' ');
 }  }
Line 383  locale_advance(struct termp *p, size_t len)
Line 389  locale_advance(struct termp *p, size_t len)
 {  {
         size_t          i;          size_t          i;
   
         assert(len < UINT16_MAX);          /*
            * XXX We used to have "assert(len < UINT16_MAX)" here.
            * that is not quite right because the input document
            * can trigger that by merely providing large input.
            * For now, simply truncate.
            */
           if (len > 256)
                   len = 256;
         for (i = 0; i < len; i++)          for (i = 0; i < len; i++)
                 putwchar(L' ');                  putwchar(L' ');
 }  }

Legend:
Removed from v.1.65  
changed lines
  Added in v.1.69

CVSweb