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

Diff for /mandoc/man.c between version 1.89 and 1.90

version 1.89, 2010/12/05 16:14:16 version 1.90, 2010/12/06 13:49:02
Line 473  man_pmacro(struct man *m, int ln, char *buf, int offs)
Line 473  man_pmacro(struct man *m, int ln, char *buf, int offs)
   
         tok = (j > 0 && j < 4) ? man_hash_find(mac) : MAN_MAX;          tok = (j > 0 && j < 4) ? man_hash_find(mac) : MAN_MAX;
         if (MAN_MAX == tok) {          if (MAN_MAX == tok) {
                 man_vmsg(m, MANDOCERR_MACRO, ln, ppos,                  man_vmsg(m, MANDOCERR_MACRO, ln, ppos, "%s", buf + ppos - 1);
                     "unknown macro: %s%s",  
                     buf, strlen(buf) > 3 ? "..." : "");  
                 return(1);                  return(1);
         }          }
   
Line 494  man_pmacro(struct man *m, int ln, char *buf, int offs)
Line 492  man_pmacro(struct man *m, int ln, char *buf, int offs)
                         goto err;                          goto err;
   
         /*          /*
          * Remove prior ELINE macro, as it's being clobbering by a new           * Remove prior ELINE macro, as it's being clobbered by a new
          * macro.  Note that NSCOPED macros do not close out ELINE           * macro.  Note that NSCOPED macros do not close out ELINE
          * macros---they don't print text---so we let those slip by.           * macros---they don't print text---so we let those slip by.
          */           */
   
         if ( ! (MAN_NSCOPED & man_macros[tok].flags) &&          if ( ! (MAN_NSCOPED & man_macros[tok].flags) &&
                         m->flags & MAN_ELINE) {                          m->flags & MAN_ELINE) {
                 assert(MAN_TEXT != m->last->type);  
   
                 /*  
                  * This occurs in the following construction:  
                  *   .B  
                  *   .br  
                  *   .B  
                  *   .br  
                  *   I hate man macros.  
                  * Flat-out disallow this madness.  
                  */  
                 if (MAN_NSCOPED & man_macros[m->last->tok].flags) {  
                         man_pmsg(m, ln, ppos, MANDOCERR_SYNTLINESCOPE);  
                         return(0);  
                 }  
   
                 n = m->last;                  n = m->last;
                   assert(MAN_TEXT != n->type);
   
                 assert(n);                  /* Remove repeated NSCOPED macros causing ELINE. */
                 assert(NULL == n->child);  
                 assert(0 == n->nchild);  
   
                 if ( ! man_nmsg(m, n, MANDOCERR_LINESCOPE))                  if (MAN_NSCOPED & man_macros[n->tok].flags)
                         return(0);                          n = n->parent;
   
                   man_vmsg(m, MANDOCERR_LINESCOPE, n->line, n->pos,
                                   "%s", man_macronames[n->tok]);
   
                 man_node_delete(m, n);                  man_node_delete(m, n);
                 m->flags &= ~MAN_ELINE;                  m->flags &= ~MAN_ELINE;

Legend:
Removed from v.1.89  
changed lines
  Added in v.1.90

CVSweb