[BACK]Return to term.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mandoc

Diff for /src/usr.bin/mandoc/term.c between version 1.56 and 1.57

version 1.56, 2011/01/30 16:05:29 version 1.57, 2011/04/21 22:59:54
Line 76 
Line 76 
 {  {
         struct termp    *p;          struct termp    *p;
   
         p = calloc(1, sizeof(struct termp));          p = mandoc_calloc(1, sizeof(struct termp));
         if (NULL == p) {  
                 perror(NULL);  
                 exit((int)MANDOCLEVEL_SYSERR);  
         }  
   
         p->enc = enc;          p->enc = enc;
         return(p);          return(p);
 }  }
Line 464 
Line 459 
   
         sv = word;          sv = word;
   
         if (word[0] && '\0' == word[1])          if (DELIM_CLOSE == mandoc_isdelim(word))
                 switch (word[0]) {                  if ( ! (TERMP_IGNDELIM & p->flags))
                 case('.'):                          p->flags |= TERMP_NOSPACE;
                         /* FALLTHROUGH */  
                 case(','):  
                         /* FALLTHROUGH */  
                 case(';'):  
                         /* FALLTHROUGH */  
                 case(':'):  
                         /* FALLTHROUGH */  
                 case('?'):  
                         /* FALLTHROUGH */  
                 case('!'):  
                         /* FALLTHROUGH */  
                 case(')'):  
                         /* FALLTHROUGH */  
                 case(']'):  
                         if ( ! (TERMP_IGNDELIM & p->flags))  
                                 p->flags |= TERMP_NOSPACE;  
                         break;  
                 default:  
                         break;  
                 }  
   
         if ( ! (TERMP_NOSPACE & p->flags)) {          if ( ! (TERMP_NOSPACE & p->flags)) {
                 if ( ! (TERMP_KEEP & p->flags)) {                  if ( ! (TERMP_KEEP & p->flags)) {
Line 510 
Line 485 
                 if ((ssz = strcspn(word, "\\")) > 0)                  if ((ssz = strcspn(word, "\\")) > 0)
                         encode(p, word, ssz);                          encode(p, word, ssz);
   
                 word += ssz;                  word += (int)ssz;
                 if ('\\' != *word)                  if ('\\' != *word)
                         continue;                          continue;
   
Line 549 
Line 524 
                         p->flags |= TERMP_NOSPACE;                          p->flags |= TERMP_NOSPACE;
         }          }
   
         /*          if (DELIM_OPEN == mandoc_isdelim(sv))
          * Note that we don't process the pipe: the parser sees it as                  p->flags |= TERMP_NOSPACE;
          * punctuation, but we don't in terms of typography.  
          */  
         if (sv[0] && '\0' == sv[1])  
                 switch (sv[0]) {  
                 case('('):  
                         /* FALLTHROUGH */  
                 case('['):  
                         p->flags |= TERMP_NOSPACE;  
                         break;  
                 default:  
                         break;  
                 }  
 }  }
   
   
Line 575 
Line 538 
         while (sz >= p->maxcols)          while (sz >= p->maxcols)
                 p->maxcols <<= 2;                  p->maxcols <<= 2;
   
         p->buf = realloc(p->buf, p->maxcols);          p->buf = mandoc_realloc(p->buf, p->maxcols);
         if (NULL == p->buf) {  
                 perror(NULL);  
                 exit((int)MANDOCLEVEL_SYSERR);  
         }  
 }  }
   
   

Legend:
Removed from v.1.56  
changed lines
  Added in v.1.57