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

Diff for /src/usr.bin/mandoc/mdoc_validate.c between version 1.172 and 1.173

version 1.172, 2014/11/26 19:23:47 version 1.173, 2014/11/27 16:20:27
Line 16 
Line 16 
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF   * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */   */
   
 #include <sys/types.h>  #include <sys/types.h>
 #ifndef OSNAME  #ifndef OSNAME
 #include <sys/utsname.h>  #include <sys/utsname.h>
Line 71 
Line 70 
 static  size_t          macro2len(enum mdoct);  static  size_t          macro2len(enum mdoct);
 static  void     rewrite_macro2len(char **);  static  void     rewrite_macro2len(char **);
   
 static  int      ebool(POST_ARGS);  
 static  int      berr_ge1(POST_ARGS);  static  int      berr_ge1(POST_ARGS);
 static  int      bwarn_ge1(POST_ARGS);  static  int      bwarn_ge1(POST_ARGS);
 static  int      ewarn_eq0(POST_ARGS);  static  int      ewarn_eq0(POST_ARGS);
Line 121 
Line 119 
 static  int      post_sh_name(POST_ARGS);  static  int      post_sh_name(POST_ARGS);
 static  int      post_sh_see_also(POST_ARGS);  static  int      post_sh_see_also(POST_ARGS);
 static  int      post_sh_authors(POST_ARGS);  static  int      post_sh_authors(POST_ARGS);
   static  int      post_sm(POST_ARGS);
 static  int      post_st(POST_ARGS);  static  int      post_st(POST_ARGS);
 static  int      post_vt(POST_ARGS);  static  int      post_vt(POST_ARGS);
 static  int      pre_an(PRE_ARGS);  static  int      pre_an(PRE_ARGS);
Line 198 
Line 197 
         { NULL, NULL },                         /* Bq */          { NULL, NULL },                         /* Bq */
         { NULL, NULL },                         /* Bsx */          { NULL, NULL },                         /* Bsx */
         { NULL, post_bx },                      /* Bx */          { NULL, post_bx },                      /* Bx */
         { NULL, ebool },                        /* Db */          { pre_obsolete, NULL },                 /* Db */
         { NULL, NULL },                         /* Dc */          { NULL, NULL },                         /* Dc */
         { NULL, NULL },                         /* Do */          { NULL, NULL },                         /* Do */
         { NULL, NULL },                         /* Dq */          { NULL, NULL },                         /* Dq */
Line 225 
Line 224 
         { NULL, NULL },                         /* Sc */          { NULL, NULL },                         /* Sc */
         { NULL, NULL },                         /* So */          { NULL, NULL },                         /* So */
         { NULL, NULL },                         /* Sq */          { NULL, NULL },                         /* Sq */
         { NULL, ebool },                        /* Sm */          { NULL, post_sm },                      /* Sm */
         { NULL, post_hyph },                    /* Sx */          { NULL, post_hyph },                    /* Sx */
         { NULL, NULL },                         /* Sy */          { NULL, NULL },                         /* Sy */
         { NULL, NULL },                         /* Tn */          { NULL, NULL },                         /* Tn */
Line 1621 
Line 1620 
 }  }
   
 static int  static int
 ebool(struct mdoc *mdoc)  post_sm(struct mdoc *mdoc)
 {  {
         struct mdoc_node        *nch;          struct mdoc_node        *nch;
         enum mdoct               tok;  
   
         tok = mdoc->last->tok;  
         nch = mdoc->last->child;          nch = mdoc->last->child;
   
         if (NULL == nch) {          if (nch == NULL) {
                 if (MDOC_Sm == tok)                  mdoc->flags ^= MDOC_SMOFF;
                         mdoc->flags ^= MDOC_SMOFF;  
                 return(1);                  return(1);
         }          }
   
         assert(MDOC_TEXT == nch->type);          assert(nch->type == MDOC_TEXT);
   
         if (0 == strcmp(nch->string, "on")) {          if ( ! strcmp(nch->string, "on")) {
                 if (MDOC_Sm == tok)                  mdoc->flags &= ~MDOC_SMOFF;
                         mdoc->flags &= ~MDOC_SMOFF;  
                 return(1);                  return(1);
         }          }
         if (0 == strcmp(nch->string, "off")) {          if ( ! strcmp(nch->string, "off")) {
                 if (MDOC_Sm == tok)                  mdoc->flags |= MDOC_SMOFF;
                         mdoc->flags |= MDOC_SMOFF;  
                 return(1);                  return(1);
         }          }
   
         mandoc_vmsg(MANDOCERR_SM_BAD,          mandoc_vmsg(MANDOCERR_SM_BAD,
             mdoc->parse, nch->line, nch->pos,              mdoc->parse, nch->line, nch->pos,
             "%s %s", mdoc_macronames[tok], nch->string);              "%s %s", mdoc_macronames[mdoc->last->tok], nch->string);
         return(mdoc_node_relink(mdoc, nch));          return(mdoc_node_relink(mdoc, nch));
 }  }
   

Legend:
Removed from v.1.172  
changed lines
  Added in v.1.173