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

Diff for /mandoc/term.c between version 1.191 and 1.193

version 1.191, 2011/05/15 22:29:50 version 1.193, 2011/05/17 14:38:34
Line 69  term_end(struct termp *p)
Line 69  term_end(struct termp *p)
         (*p->end)(p);          (*p->end)(p);
 }  }
   
   
 struct termp *  
 term_alloc(enum termenc enc)  
 {  
         struct termp    *p;  
   
         p = mandoc_calloc(1, sizeof(struct termp));  
         p->enc = enc;  
         return(p);  
 }  
   
   
 /*  /*
  * Flush a line of text.  A "line" is loosely defined as being something   * Flush a line of text.  A "line" is loosely defined as being something
  * that should be followed by a newline, regardless of whether it's   * that should be followed by a newline, regardless of whether it's
Line 451  term_word(struct termp *p, const char *word)
Line 439  term_word(struct termp *p, const char *word)
                         break;                          break;
   
                 switch (esc) {                  switch (esc) {
                   case (ESCAPE_UNICODE):
                           encode(p, "?", 1);
                           break;
                 case (ESCAPE_NUMBERED):                  case (ESCAPE_NUMBERED):
                         if ('\0' != (c = mchars_num2char(seq, sz)))                          if ('\0' != (c = mchars_num2char(seq, sz)))
                                 encode(p, &c, 1);                                  encode(p, &c, 1);
Line 584  term_strlen(const struct termp *p, const char *cp)
Line 575  term_strlen(const struct termp *p, const char *cp)
                 for (i = 0; i < rsz; i++)                  for (i = 0; i < rsz; i++)
                         sz += (*p->width)(p, *cp++);                          sz += (*p->width)(p, *cp++);
   
                   c = 0;
                 switch (*cp) {                  switch (*cp) {
                 case ('\\'):                  case ('\\'):
                         cp++;                          cp++;
Line 591  term_strlen(const struct termp *p, const char *cp)
Line 583  term_strlen(const struct termp *p, const char *cp)
                         switch (mandoc_escape(&cp, &seq, &ssz)) {                          switch (mandoc_escape(&cp, &seq, &ssz)) {
                         case (ESCAPE_ERROR):                          case (ESCAPE_ERROR):
                                 return(sz);                                  return(sz);
                           case (ESCAPE_UNICODE):
                                   c = '?';
                                   /* FALLTHROUGH */
                         case (ESCAPE_NUMBERED):                          case (ESCAPE_NUMBERED):
                                 c = mchars_num2char(seq, ssz);                                  if ('\0' != c)
                                           c = mchars_num2char(seq, ssz);
                                 if ('\0' != c)                                  if ('\0' != c)
                                         sz += (*p->width)(p, c);                                          sz += (*p->width)(p, c);
                                 break;                                  break;

Legend:
Removed from v.1.191  
changed lines
  Added in v.1.193

CVSweb