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

Diff for /src/usr.bin/mandoc/roff.c between version 1.253 and 1.254

version 1.253, 2022/04/13 13:11:33 version 1.254, 2022/04/24 13:34:53
Line 3868 
Line 3868 
 roff_shift(ROFF_ARGS)  roff_shift(ROFF_ARGS)
 {  {
         struct mctx     *ctx;          struct mctx     *ctx;
         int              levels, i;          int              argpos, levels, i;
   
           argpos = pos;
         levels = 1;          levels = 1;
         if (buf->buf[pos] != '\0' &&          if (buf->buf[pos] != '\0' &&
             roff_evalnum(r, ln, buf->buf, &pos, &levels, 0) == 0) {              roff_evalnum(r, ln, buf->buf, &pos, &levels, 0) == 0) {
Line 3884 
Line 3885 
         ctx = r->mstack + r->mstackpos;          ctx = r->mstack + r->mstackpos;
         if (levels > ctx->argc) {          if (levels > ctx->argc) {
                 mandoc_msg(MANDOCERR_SHIFT,                  mandoc_msg(MANDOCERR_SHIFT,
                     ln, pos, "%d, but max is %d", levels, ctx->argc);                      ln, argpos, "%d, but max is %d", levels, ctx->argc);
                 levels = ctx->argc;                  levels = ctx->argc;
           }
           if (levels < 0) {
                   mandoc_msg(MANDOCERR_ARG_NEG, ln, argpos, "shift %d", levels);
                   levels = 0;
         }          }
         if (levels == 0)          if (levels == 0)
                 return ROFF_IGN;                  return ROFF_IGN;

Legend:
Removed from v.1.253  
changed lines
  Added in v.1.254