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

Diff for /src/usr.bin/mandoc/mdoc_term.c between version 1.47 and 1.48

version 1.47, 2009/08/09 20:37:32 version 1.48, 2009/08/09 21:38:25
Line 666 
Line 666 
   
         if (MDOC_Bl == bl->tok && arg_hasattr(MDOC_Compact, bl))          if (MDOC_Bl == bl->tok && arg_hasattr(MDOC_Compact, bl))
                 return;                  return;
           assert(node);
   
         /*          /*
          * Search through our prior nodes.  If we follow a `Ss' or `Sh',           * Search through our prior nodes.  If we follow a `Ss' or `Sh',
Line 850 
Line 851 
   
         switch (type) {          switch (type) {
         case (MDOC_Diag):          case (MDOC_Diag):
                 term_word(p, "\\ \\ ");                  if (MDOC_BODY == node->type)
                           term_word(p, "\\ \\ ");
                 break;                  break;
         case (MDOC_Inset):          case (MDOC_Inset):
                 if (MDOC_BODY == node->type)                  if (MDOC_BODY == node->type)
Line 1595 
Line 1597 
         } else if (MDOC_BODY != node->type)          } else if (MDOC_BODY != node->type)
                 return(1);                  return(1);
   
         /* FIXME: display type should be mandated by parser. */          assert(node->parent->args);
   
         if (NULL == node->parent->args)          for (type = -1, i = 0; -1 == type &&
                 errx(1, "missing display type");  
   
         for (type = -1, i = 0;  
                         i < (int)node->parent->args->argc; i++) {                          i < (int)node->parent->args->argc; i++) {
                 switch (node->parent->args->argv[i].arg) {                  switch (node->parent->args->argv[i].arg) {
                 case (MDOC_Ragged):                  case (MDOC_Ragged):
Line 1611 
Line 1610 
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                 case (MDOC_Literal):                  case (MDOC_Literal):
                         type = node->parent->args->argv[i].arg;                          type = node->parent->args->argv[i].arg;
                         i = (int)node->parent->args->argc;  
                         break;                          break;
                 default:                  default:
                         break;                          break;
                 }                  }
         }          }
   
           assert(type > -1);
   
         if (NULL == node->parent->args)  
                 errx(1, "missing display type");  
   
         i = arg_getattr(MDOC_Offset, node->parent);          i = arg_getattr(MDOC_Offset, node->parent);
         if (-1 != i) {          if (-1 != i)
                 if (1 != node->parent->args->argv[i].sz)  
                         errx(1, "expected single value");  
                 p->offset += arg_offset(&node->parent->args->argv[i]);                  p->offset += arg_offset(&node->parent->args->argv[i]);
         }  
   
         switch (type) {          switch (type) {
         case (MDOC_Literal):          case (MDOC_Literal):
Line 1637 
Line 1631 
                 return(1);                  return(1);
         }          }
   
         /*  
          * Tricky.  Iterate through all children.  If we're on a  
          * different parse line, append a newline and then the contents.  
          * Ew.  
          */  
   
         ln = node->child ? node->child->line : 0;  
   
         for (node = node->child; node; node = node->next) {          for (node = node->child; node; node = node->next) {
                 if (ln < node->line) {                  p->flags |= TERMP_NOSPACE;
                         term_flushln(p);  
                         p->flags |= TERMP_NOSPACE;  
                 }  
                 ln = node->line;  
                 print_node(p, pair, meta, node);                  print_node(p, pair, meta, node);
                   if (node->next)
                           term_flushln(p);
         }          }
   
         return(0);          return(0);
Line 1665 
Line 1649 
   
         if (MDOC_BODY != node->type)          if (MDOC_BODY != node->type)
                 return;                  return;
           p->flags |= TERMP_NOSPACE;
         term_flushln(p);          term_flushln(p);
 }  }
   

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.48