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

Diff for /mandoc/mdoc_term.c between version 1.264 and 1.266

version 1.264, 2014/04/20 16:46:05 version 1.266, 2014/04/20 20:18:12
Line 30 
Line 30 
 #include <string.h>  #include <string.h>
   
 #include "mandoc.h"  #include "mandoc.h"
   #include "mandoc_aux.h"
 #include "out.h"  #include "out.h"
 #include "term.h"  #include "term.h"
 #include "mdoc.h"  #include "mdoc.h"
Line 441  print_mdoc_foot(struct termp *p, const void *arg)
Line 442  print_mdoc_foot(struct termp *p, const void *arg)
 static void  static void
 print_mdoc_head(struct termp *p, const void *arg)  print_mdoc_head(struct termp *p, const void *arg)
 {  {
         char            buf[BUFSIZ], title[BUFSIZ];          char                     buf[BUFSIZ];
         size_t          buflen, titlen;          const struct mdoc_meta  *meta;
         const struct mdoc_meta *meta;          char                    *title;
           size_t                   buflen, titlen;
   
         meta = (const struct mdoc_meta *)arg;          meta = (const struct mdoc_meta *)arg;
   
Line 473  print_mdoc_head(struct termp *p, const void *arg)
Line 475  print_mdoc_head(struct termp *p, const void *arg)
                 strlcat(buf, ")", BUFSIZ);                  strlcat(buf, ")", BUFSIZ);
         }          }
   
         snprintf(title, BUFSIZ, "%s(%s)", meta->title, meta->msec);          mandoc_asprintf(&title, "%s(%s)", meta->title, meta->msec);
         titlen = term_strlen(p, title);          titlen = term_strlen(p, title);
   
         p->flags |= TERMP_NOBREAK | TERMP_NOSPACE;          p->flags |= TERMP_NOBREAK | TERMP_NOSPACE;
Line 508  print_mdoc_head(struct termp *p, const void *arg)
Line 510  print_mdoc_head(struct termp *p, const void *arg)
         p->flags &= ~TERMP_NOSPACE;          p->flags &= ~TERMP_NOSPACE;
         p->offset = 0;          p->offset = 0;
         p->rmargin = p->maxrmargin;          p->rmargin = p->maxrmargin;
           free(title);
 }  }
   
 static size_t  static size_t
Line 620  static int
Line 623  static int
 termp_it_pre(DECL_ARGS)  termp_it_pre(DECL_ARGS)
 {  {
         const struct mdoc_node *bl, *nn;          const struct mdoc_node *bl, *nn;
         char                    buf[7];          char                    buf[24];
         int                     i;          int                     i;
         size_t                  width, offset, ncols, dcol;          size_t                  width, offset, ncols, dcol;
         enum mdoc_list          type;          enum mdoc_list          type;
Line 916  termp_it_pre(DECL_ARGS)
Line 919  termp_it_pre(DECL_ARGS)
                         break;                          break;
                 case LIST_enum:                  case LIST_enum:
                         (pair->ppair->ppair->count)++;                          (pair->ppair->ppair->count)++;
                         snprintf(buf, sizeof(buf), "%d.",                          (void)snprintf(buf, sizeof(buf), "%d.",
                             pair->ppair->ppair->count);                              pair->ppair->ppair->count);
                         term_word(p, buf);                          term_word(p, buf);
                         break;                          break;

Legend:
Removed from v.1.264  
changed lines
  Added in v.1.266

CVSweb