[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.79 and 1.81

version 1.79, 2010/05/17 22:11:42 version 1.81, 2010/05/24 12:31:16
Line 23 
Line 23 
 #include <assert.h>  #include <assert.h>
 #include <ctype.h>  #include <ctype.h>
 #include <limits.h>  #include <limits.h>
   #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   
Line 568  pre_bl(PRE_ARGS)
Line 569  pre_bl(PRE_ARGS)
                 case (MDOC_Inset):                  case (MDOC_Inset):
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                 case (MDOC_Column):                  case (MDOC_Column):
                         /*                          if (type < 0) {
                          * Note that if a duplicate is detected, we                                  type = n->args->argv[pos].arg;
                          * remove the duplicate instead of passing it  
                          * over.  If we don't do this, mdoc_action will  
                          * become confused when it scans over multiple  
                          * types whilst setting its bitmasks.  
                          *  
                          * FIXME: this should occur in mdoc_action.c.  
                          */  
                         if (type >= 0) {  
                                 if ( ! mdoc_nmsg(mdoc, n, MANDOCERR_LISTREP))  
                                         return(0);  
                                 mdoc_argn_free(n->args, pos);  
                                 break;                                  break;
                         }                          }
                         type = n->args->argv[pos].arg;                          if (mdoc_nmsg(mdoc, n, MANDOCERR_LISTREP))
                         break;                                  break;
                           return(0);
                 case (MDOC_Compact):                  case (MDOC_Compact):
                         if (type < 0 && ! mdoc_nmsg(mdoc, n, MANDOCERR_LISTFIRST))                          if (type >= 0)
                                 return(0);                                  break;
                         break;                          if (mdoc_nmsg(mdoc, n, MANDOCERR_LISTFIRST))
                                   break;
                           return(0);
                 case (MDOC_Width):                  case (MDOC_Width):
                         if (width >= 0)                          if (width >= 0)
                                 if ( ! mdoc_nmsg(mdoc, n, MANDOCERR_ARGVREP))                                  if ( ! mdoc_nmsg(mdoc, n, MANDOCERR_ARGVREP))
Line 1232  post_sh_body(POST_ARGS)
Line 1225  post_sh_body(POST_ARGS)
 static int  static int
 post_sh_head(POST_ARGS)  post_sh_head(POST_ARGS)
 {  {
         char                    buf[64];          char                    buf[BUFSIZ];
         enum mdoc_sec           sec;          enum mdoc_sec           sec;
         const struct mdoc_node *n;          const struct mdoc_node *n;
   
Line 1254  post_sh_head(POST_ARGS)
Line 1247  post_sh_head(POST_ARGS)
                 /* XXX - copied from compact(). */                  /* XXX - copied from compact(). */
                 assert(MDOC_TEXT == n->type);                  assert(MDOC_TEXT == n->type);
   
                 if (strlcat(buf, n->string, 64) >= 64) {                  if (strlcat(buf, n->string, BUFSIZ) >= BUFSIZ) {
                         mdoc_nmsg(mdoc, n, MANDOCERR_MEM);                          mdoc_nmsg(mdoc, n, MANDOCERR_MEM);
                         return(0);                          return(0);
                 }                  }
                 if (NULL == n->next)                  if (NULL == n->next)
                         continue;                          continue;
                 if (strlcat(buf, " ", 64) >= 64) {                  if (strlcat(buf, " ", BUFSIZ) >= BUFSIZ) {
                         mdoc_nmsg(mdoc, n, MANDOCERR_MEM);                          mdoc_nmsg(mdoc, n, MANDOCERR_MEM);
                         return(0);                          return(0);
                 }                  }

Legend:
Removed from v.1.79  
changed lines
  Added in v.1.81

CVSweb