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

Diff for /mandoc/mdoc_validate.c between version 1.185 and 1.187

version 1.185, 2012/07/10 14:38:51 version 1.187, 2012/07/12 15:11:14
Line 314  static const enum mdoct rsord[RSORD_MAX] = {
Line 314  static const enum mdoct rsord[RSORD_MAX] = {
         MDOC__R,          MDOC__R,
         MDOC__N,          MDOC__N,
         MDOC__V,          MDOC__V,
           MDOC__U,
         MDOC__P,          MDOC__P,
         MDOC__Q,          MDOC__Q,
         MDOC__D,          MDOC__D,
         MDOC__O,          MDOC__O,
         MDOC__C,          MDOC__C
         MDOC__U  
 };  };
   
 static  const char * const secnames[SEC__MAX] = {  static  const char * const secnames[SEC__MAX] = {
Line 1123  post_nm(POST_ARGS)
Line 1123  post_nm(POST_ARGS)
         char             buf[BUFSIZ];          char             buf[BUFSIZ];
         int              c;          int              c;
   
         /* If no child specified, make sure we have the meta name. */          if (NULL != mdoc->meta.name)
   
         if (NULL == mdoc->last->child && NULL == mdoc->meta.name) {  
                 mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_NONAME);  
                 return(1);                  return(1);
         } else if (mdoc->meta.name)  
                 return(1);  
   
         /* If no meta name, set it from the child. */          /* Try to use our children for setting the meta name. */
   
         buf[0] = '\0';          if (NULL != mdoc->last->child) {
         if (-1 == (c = concat(buf, mdoc->last->child, BUFSIZ))) {                  buf[0] = '\0';
                   c = concat(buf, mdoc->last->child, BUFSIZ);
           } else
                   c = 0;
   
           switch (c) {
           case (-1):
                 mdoc_nmsg(mdoc, mdoc->last->child, MANDOCERR_MEM);                  mdoc_nmsg(mdoc, mdoc->last->child, MANDOCERR_MEM);
                 return(0);                  return(0);
           case (0):
                   mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_NONAME);
                   mdoc->meta.name = mandoc_strdup("UNKNOWN");
                   break;
           default:
                   mdoc->meta.name = mandoc_strdup(buf);
                   break;
         }          }
   
         assert(c);  
         mdoc->meta.name = mandoc_strdup(buf);  
         return(1);          return(1);
 }  }
   

Legend:
Removed from v.1.185  
changed lines
  Added in v.1.187

CVSweb