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

Diff for /mandoc/mdoc.c between version 1.164 and 1.170

version 1.164, 2010/08/29 11:29:51 version 1.170, 2010/12/16 17:14:48
Line 286  mdoc_macro(MACRO_PROT_ARGS)
Line 286  mdoc_macro(MACRO_PROT_ARGS)
                         ! (MDOC_PBODY & m->flags)) {                          ! (MDOC_PBODY & m->flags)) {
                 if ( ! mdoc_pmsg(m, line, ppos, MANDOCERR_BADPROLOG))                  if ( ! mdoc_pmsg(m, line, ppos, MANDOCERR_BADPROLOG))
                         return(0);                          return(0);
                   if (NULL == m->meta.msec)
                           m->meta.msec = mandoc_strdup("1");
                 if (NULL == m->meta.title)                  if (NULL == m->meta.title)
                         m->meta.title = mandoc_strdup("UNKNOWN");                          m->meta.title = mandoc_strdup("UNKNOWN");
                 if (NULL == m->meta.vol)                  if (NULL == m->meta.vol)
Line 328  node_append(struct mdoc *mdoc, struct mdoc_node *p)
Line 330  node_append(struct mdoc *mdoc, struct mdoc_node *p)
   
         if ( ! mdoc_valid_pre(mdoc, p))          if ( ! mdoc_valid_pre(mdoc, p))
                 return(0);                  return(0);
         if ( ! mdoc_action_pre(mdoc, p))  
                 return(0);  
   
         switch (p->type) {          switch (p->type) {
         case (MDOC_HEAD):          case (MDOC_HEAD):
Line 356  node_append(struct mdoc *mdoc, struct mdoc_node *p)
Line 356  node_append(struct mdoc *mdoc, struct mdoc_node *p)
         case (MDOC_TEXT):          case (MDOC_TEXT):
                 if ( ! mdoc_valid_post(mdoc))                  if ( ! mdoc_valid_post(mdoc))
                         return(0);                          return(0);
                 if ( ! mdoc_action_post(mdoc))  
                         return(0);  
                 break;                  break;
         default:          default:
                 break;                  break;
Line 528  mdoc_node_free(struct mdoc_node *p)
Line 526  mdoc_node_free(struct mdoc_node *p)
         if (MDOC_Bf == p->tok && MDOC_HEAD == p->type)          if (MDOC_Bf == p->tok && MDOC_HEAD == p->type)
                 if (p->data.Bf)                  if (p->data.Bf)
                         free(p->data.Bf);                          free(p->data.Bf);
           if (MDOC_An == p->tok)
                   if (p->data.An)
                           free(p->data.An);
   
         if (p->string)          if (p->string)
                 free(p->string);                  free(p->string);
Line 554  mdoc_node_unlink(struct mdoc *m, struct mdoc_node *n)
Line 555  mdoc_node_unlink(struct mdoc *m, struct mdoc_node *n)
                 n->parent->nchild--;                  n->parent->nchild--;
                 if (n->parent->child == n)                  if (n->parent->child == n)
                         n->parent->child = n->prev ? n->prev : n->next;                          n->parent->child = n->prev ? n->prev : n->next;
                   if (n->parent->last == n)
                           n->parent->last = n->prev ? n->prev : NULL;
         }          }
   
         /* Adjust parse point, if applicable. */          /* Adjust parse point, if applicable. */
Line 691  mdoc_ptext(struct mdoc *m, int line, char *buf, int of
Line 694  mdoc_ptext(struct mdoc *m, int line, char *buf, int of
                         return(0);                          return(0);
   
                 /*                  /*
                  * Insert a `Pp' in the case of a blank line.  Technically,                   * Insert a `sp' in the case of a blank line.  Technically,
                  * blank lines aren't allowed, but enough manuals assume this                   * blank lines aren't allowed, but enough manuals assume this
                  * behaviour that we want to work around it.                   * behaviour that we want to work around it.
                  */                   */
                 if ( ! mdoc_elem_alloc(m, line, offs, MDOC_Pp, NULL))                  if ( ! mdoc_elem_alloc(m, line, offs, MDOC_sp, NULL))
                         return(0);                          return(0);
   
                 m->next = MDOC_NEXT_SIBLING;                  m->next = MDOC_NEXT_SIBLING;
Line 758  mdoc_pmacro(struct mdoc *m, int ln, char *buf, int off
Line 761  mdoc_pmacro(struct mdoc *m, int ln, char *buf, int off
   
         /*          /*
          * Copy the first word into a nil-terminated buffer.           * Copy the first word into a nil-terminated buffer.
          * Stop copying when a tab, space, backslash, or eoln is encountered.           * Stop copying when a tab, space, or eoln is encountered.
          */           */
   
         j = 0;          j = 0;
         while (j < 4 && '\0' != buf[i] &&          while (j < 4 && '\0' != buf[i] && ' ' != buf[i] && '\t' != buf[i])
                         ' ' != buf[i] &&  
                         '\t' != buf[i] &&  
                         '\\' != buf[i])  
                 mac[j++] = buf[i++];                  mac[j++] = buf[i++];
         mac[j] = '\0';          mac[j] = '\0';
   
         tok = (j > 1 || j < 4) ? mdoc_hash_find(mac) : MDOC_MAX;          tok = (j > 1 || j < 4) ? mdoc_hash_find(mac) : MDOC_MAX;
         if (MDOC_MAX == tok) {          if (MDOC_MAX == tok) {
                 mdoc_vmsg(m, MANDOCERR_MACRO, ln, sv,                  mdoc_vmsg(m, MANDOCERR_MACRO, ln, sv, "%s", buf + sv - 1);
                     "unknown macro: %s%s",  
                     buf, strlen(buf) > 3 ? "..." : "");  
                 return(1);                  return(1);
         }          }
   

Legend:
Removed from v.1.164  
changed lines
  Added in v.1.170

CVSweb