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

Diff for /mandoc/roff.c between version 1.243 and 1.246

version 1.243, 2014/12/16 23:44:41 version 1.246, 2014/12/28 14:16:26
Line 21 
Line 21 
   
 #include <assert.h>  #include <assert.h>
 #include <ctype.h>  #include <ctype.h>
   #include <limits.h>
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
Line 650  roff_res(struct roff *r, struct buf *buf, int ln, int 
Line 651  roff_res(struct roff *r, struct buf *buf, int ln, int 
                             r->parse, ln, (int)(stesc - buf->buf),                              r->parse, ln, (int)(stesc - buf->buf),
                             "%.*s", (int)naml, stnam);                              "%.*s", (int)naml, stnam);
                         res = "";                          res = "";
                   } else if (buf->sz + strlen(res) > SHRT_MAX) {
                           mandoc_msg(MANDOCERR_ROFFLOOP, r->parse,
                               ln, (int)(stesc - buf->buf), NULL);
                           return(ROFF_IGN);
                 }                  }
   
                 /* Replace the escape sequence by the string. */                  /* Replace the escape sequence by the string. */
Line 1576  roff_evalnum(struct roff *r, int ln, const char *v,
Line 1581  roff_evalnum(struct roff *r, int ln, const char *v,
                         *res *= operand2;                          *res *= operand2;
                         break;                          break;
                 case '/':                  case '/':
                         if (0 == operand2) {                          if (operand2 == 0) {
                                 mandoc_msg(MANDOCERR_DIVZERO,                                  mandoc_msg(MANDOCERR_DIVZERO,
                                         r->parse, ln, *pos, v);                                          r->parse, ln, *pos, v);
                                 *res = 0;                                  *res = 0;
Line 1585  roff_evalnum(struct roff *r, int ln, const char *v,
Line 1590  roff_evalnum(struct roff *r, int ln, const char *v,
                         *res /= operand2;                          *res /= operand2;
                         break;                          break;
                 case '%':                  case '%':
                           if (operand2 == 0) {
                                   mandoc_msg(MANDOCERR_DIVZERO,
                                           r->parse, ln, *pos, v);
                                   *res = 0;
                                   break;
                           }
                         *res %= operand2;                          *res %= operand2;
                         break;                          break;
                 case '<':                  case '<':

Legend:
Removed from v.1.243  
changed lines
  Added in v.1.246

CVSweb