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

Diff for /mandoc/term.c between version 1.95 and 1.97

version 1.95, 2009/07/27 12:35:54 version 1.97, 2009/07/28 10:15:12
Line 391  do_special(struct termp *p, const char *word, size_t l
Line 391  do_special(struct termp *p, const char *word, size_t l
   
         rhs = term_a2ascii(p->symtab, word, len, &sz);          rhs = term_a2ascii(p->symtab, word, len, &sz);
   
         if (NULL == rhs)          if (NULL == rhs) {
   #if 0
                   fputs("Unknown special character: ", stderr);
                   for (i = 0; i < (int)len; i++)
                           fputc(word[i], stderr);
                   fputc('\n', stderr);
   #endif
                 return;                  return;
           }
         for (i = 0; i < (int)sz; i++)          for (i = 0; i < (int)sz; i++)
                 encode(p, rhs[i]);                  encode(p, rhs[i]);
 }  }
Line 407  do_reserved(struct termp *p, const char *word, size_t 
Line 414  do_reserved(struct termp *p, const char *word, size_t 
   
         rhs = term_a2res(p->symtab, word, len, &sz);          rhs = term_a2res(p->symtab, word, len, &sz);
   
         if (NULL == rhs)          if (NULL == rhs) {
   #if 0
                   fputs("Unknown reserved word: ", stderr);
                   for (i = 0; i < (int)len; i++)
                           fputc(word[i], stderr);
                   fputc('\n', stderr);
   #endif
                 return;                  return;
           }
         for (i = 0; i < (int)sz; i++)          for (i = 0; i < (int)sz; i++)
                 encode(p, rhs[i]);                  encode(p, rhs[i]);
 }  }
Line 422  do_reserved(struct termp *p, const char *word, size_t 
Line 436  do_reserved(struct termp *p, const char *word, size_t 
 static void  static void
 do_escaped(struct termp *p, const char **word)  do_escaped(struct termp *p, const char **word)
 {  {
         int              j;          int              j, type;
         const char      *wp;          const char      *wp;
   
         wp = *word;          wp = *word;
           type = 1;
   
         if (0 == *(++wp)) {          if (0 == *(++wp)) {
                 *word = wp;                  *word = wp;
Line 461  do_escaped(struct termp *p, const char **word)
Line 476  do_escaped(struct termp *p, const char **word)
                         *word = ++wp;                          *word = ++wp;
                         return;                          return;
                 case ('['):                  case ('['):
                           type = 0;
                         break;                          break;
                 default:                  default:
                         do_reserved(p, wp, 1);                          do_reserved(p, wp, 1);
Line 508  do_escaped(struct termp *p, const char **word)
Line 524  do_escaped(struct termp *p, const char **word)
                 return;                  return;
         }          }
   
         do_special(p, wp - j, (size_t)j);          if (type)
                   do_special(p, wp - j, (size_t)j);
           else
                   do_reserved(p, wp - j, (size_t)j);
         *word = wp;          *word = wp;
 }  }
   

Legend:
Removed from v.1.95  
changed lines
  Added in v.1.97

CVSweb