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

Diff for /mandoc/term.c between version 1.270 and 1.272

version 1.270, 2017/06/14 01:31:27 version 1.272, 2017/06/14 18:23:37
Line 528  term_word(struct termp *p, const char *word)
Line 528  term_word(struct termp *p, const char *word)
                 case ESCAPE_HORIZ:                  case ESCAPE_HORIZ:
                         if (a2roffsu(seq, &su, SCALE_EM) == NULL)                          if (a2roffsu(seq, &su, SCALE_EM) == NULL)
                                 continue;                                  continue;
                         uc = term_hspan(p, &su) / 24;                          uc = term_hen(p, &su);
                         if (uc > 0)                          if (uc > 0)
                                 while (uc-- > 0)                                  while (uc-- > 0)
                                         bufferc(p, ASCII_NBRSP);                                          bufferc(p, ASCII_NBRSP);
Line 547  term_word(struct termp *p, const char *word)
Line 547  term_word(struct termp *p, const char *word)
                         }                          }
                         continue;                          continue;
                 case ESCAPE_HLINE:                  case ESCAPE_HLINE:
                         if ((seq = a2roffsu(seq, &su, SCALE_EM)) == NULL)                          if ((cp = a2roffsu(seq, &su, SCALE_EM)) == NULL)
                                 continue;                                  continue;
                         uc = term_hspan(p, &su) / 24;                          uc = term_hen(p, &su);
                         if (uc <= 0) {                          if (uc <= 0) {
                                 if (p->tcol->rmargin <= p->tcol->offset)                                  if (p->tcol->rmargin <= p->tcol->offset)
                                         continue;                                          continue;
                                 lsz = p->tcol->rmargin - p->tcol->offset;                                  lsz = p->tcol->rmargin - p->tcol->offset;
                         } else                          } else
                                 lsz = uc;                                  lsz = uc;
                         if (*seq == '\0')                          if (*cp == seq[-1])
                                 uc = -1;                                  uc = -1;
                         else if (*seq == '\\') {                          else if (*cp == '\\') {
                                 seq++;                                  seq = cp + 1;
                                 esc = mandoc_escape(&seq, &cp, &sz);                                  esc = mandoc_escape(&seq, &cp, &sz);
                                 switch (esc) {                                  switch (esc) {
                                 case ESCAPE_UNICODE:                                  case ESCAPE_UNICODE:
Line 576  term_word(struct termp *p, const char *word)
Line 576  term_word(struct termp *p, const char *word)
                                         break;                                          break;
                                 }                                  }
                         } else                          } else
                                 uc = *seq;                                  uc = *cp;
                         if (uc < 0x20 || (uc > 0x7E && uc < 0xA0))                          if (uc < 0x20 || (uc > 0x7E && uc < 0xA0))
                                 uc = '_';                                  uc = '_';
                         if (p->enc == TERMENC_ASCII) {                          if (p->enc == TERMENC_ASCII) {
Line 966  term_vspan(const struct termp *p, const struct roffsu 
Line 966  term_vspan(const struct termp *p, const struct roffsu 
 }  }
   
 /*  /*
  * Convert a scaling width to basic units, rounding down.   * Convert a scaling width to basic units, rounding towards 0.
  */   */
 int  int
 term_hspan(const struct termp *p, const struct roffsu *su)  term_hspan(const struct termp *p, const struct roffsu *su)
 {  {
   
         return (*p->hspan)(p, su);          return (*p->hspan)(p, su);
   }
   
   /*
    * Convert a scaling width to basic units, rounding to closest.
    */
   int
   term_hen(const struct termp *p, const struct roffsu *su)
   {
           int bu;
   
           if ((bu = (*p->hspan)(p, su)) >= 0)
                   return (bu + 11) / 24;
           else
                   return -((-bu + 11) / 24);
 }  }

Legend:
Removed from v.1.270  
changed lines
  Added in v.1.272

CVSweb