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

Diff for /mandoc/roff.c between version 1.130 and 1.135

version 1.130, 2011/03/29 09:00:48 version 1.135, 2011/04/17 09:08:19
Line 277  roffnode_pop(struct roff *r)
Line 277  roffnode_pop(struct roff *r)
         assert(r->last);          assert(r->last);
         p = r->last;          p = r->last;
   
         if (ROFF_el == p->tok)  
                 if (r->rstackpos > -1)  
                         r->rstackpos--;  
   
         r->last = r->last->parent;          r->last = r->last->parent;
         free(p->name);          free(p->name);
         free(p->end);          free(p->end);
Line 739  roff_block(ROFF_ARGS)
Line 735  roff_block(ROFF_ARGS)
                         mandoc_msg(MANDOCERR_REQUEST, r->parse, ln, ppos,                          mandoc_msg(MANDOCERR_REQUEST, r->parse, ln, ppos,
                             roffs[tok].name);                              roffs[tok].name);
   
                 while ((*bufp)[pos] && ' ' != (*bufp)[pos])                  while ((*bufp)[pos] && ! isspace((unsigned char)(*bufp)[pos]))
                         pos++;                          pos++;
   
                 while (' ' == (*bufp)[pos])                  while (isspace((unsigned char)(*bufp)[pos]))
                         (*bufp)[pos++] = '\0';                          (*bufp)[pos++] = '\0';
         }          }
   
Line 763  roff_block(ROFF_ARGS)
Line 759  roff_block(ROFF_ARGS)
         /* If present, process the custom end-of-line marker. */          /* If present, process the custom end-of-line marker. */
   
         sv = pos;          sv = pos;
         while ((*bufp)[pos] &&          while ((*bufp)[pos] && ! isspace((unsigned char)(*bufp)[pos]))
                         ' ' != (*bufp)[pos] &&  
                         '\t' != (*bufp)[pos])  
                 pos++;                  pos++;
   
         /*          /*
Line 978  roff_cond(ROFF_ARGS)
Line 972  roff_cond(ROFF_ARGS)
         int              sv;          int              sv;
         enum roffrule    rule;          enum roffrule    rule;
   
         /* Stack overflow! */          /*
            * An `.el' has no conditional body: it will consume the value
            * of the current rstack entry set in prior `ie' calls or
            * defaults to DENY.
            *
            * If we're not an `el', however, then evaluate the conditional.
            */
   
         if (ROFF_ie == tok && r->rstackpos == RSTACK_MAX - 1) {          rule = ROFF_el == tok ?
                 mandoc_msg(MANDOCERR_MEM, r->parse, ln, ppos, NULL);                  (r->rstackpos < 0 ?
                 return(ROFF_ERR);                   ROFFRULE_DENY : r->rstack[r->rstackpos--]) :
         }                  roff_evalcond(*bufp, &pos);
   
         /* First, evaluate the conditional. */  
   
         if (ROFF_el == tok) {  
                 /*  
                  * An `.el' will get the value of the current rstack  
                  * entry set in prior `ie' calls or defaults to DENY.  
                  */  
                 if (r->rstackpos < 0)  
                         rule = ROFFRULE_DENY;  
                 else  
                         rule = r->rstack[r->rstackpos];  
         } else  
                 rule = roff_evalcond(*bufp, &pos);  
   
         sv = pos;          sv = pos;
   
         while (' ' == (*bufp)[pos])          while (' ' == (*bufp)[pos])
                 pos++;                  pos++;
   
Line 1020  roff_cond(ROFF_ARGS)
Line 1005  roff_cond(ROFF_ARGS)
   
         r->last->rule = rule;          r->last->rule = rule;
   
           /*
            * An if-else will put the NEGATION of the current evaluated
            * conditional into the stack of rules.
            */
   
         if (ROFF_ie == tok) {          if (ROFF_ie == tok) {
                 /*                  if (r->rstackpos == RSTACK_MAX - 1) {
                  * An if-else will put the NEGATION of the current                          mandoc_msg(MANDOCERR_MEM,
                  * evaluated conditional into the stack.                                  r->parse, ln, ppos, NULL);
                  */                          return(ROFF_ERR);
                 r->rstackpos++;                  }
                 if (ROFFRULE_DENY == r->last->rule)                  r->rstack[++r->rstackpos] =
                         r->rstack[r->rstackpos] = ROFFRULE_ALLOW;                          ROFFRULE_DENY == r->last->rule ?
                 else                          ROFFRULE_ALLOW : ROFFRULE_DENY;
                         r->rstack[r->rstackpos] = ROFFRULE_DENY;  
         }          }
   
         /* If the parent has false as its rule, then so do we. */          /* If the parent has false as its rule, then so do we. */
Line 1249  roff_userdef(ROFF_ARGS)
Line 1238  roff_userdef(ROFF_ARGS)
         cp = *bufp + pos;          cp = *bufp + pos;
         for (i = 0; i < 9; i++)          for (i = 0; i < 9; i++)
                 arg[i] = '\0' == *cp ? "" :                  arg[i] = '\0' == *cp ? "" :
                     mandoc_getarg(r->parse, &cp, ln, &pos);                      mandoc_getarg(r->parse, &cp, ln, 1, &pos);
   
         /*          /*
          * Expand macro arguments.           * Expand macro arguments.

Legend:
Removed from v.1.130  
changed lines
  Added in v.1.135

CVSweb