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

Diff for /mandoc/roff.c between version 1.76 and 1.77

version 1.76, 2010/05/16 14:47:19 version 1.77, 2010/05/16 19:08:11
Line 381  roff_ig(ROFF_ARGS)
Line 381  roff_ig(ROFF_ARGS)
   
         ROFF_MDEBUG(r, "opening ignore block");          ROFF_MDEBUG(r, "opening ignore block");
   
         /* FIXME: warn about end of line. */          if ((*bufp)[pos])
                   if ( ! (*r->msg)(MANDOCERR_ARGSLOST, r->data, ln, pos, NULL))
                           return(ROFF_ERR);
   
         return(ROFF_IGN);          return(ROFF_IGN);
 }  }
Line 391  roff_ig(ROFF_ARGS)
Line 393  roff_ig(ROFF_ARGS)
 static enum rofferr  static enum rofferr
 roff_if(ROFF_ARGS)  roff_if(ROFF_ARGS)
 {  {
           int              sv;
   
         /*          /*
          * Read ahead past the conditional.           * Read ahead past the conditional.
Line 399  roff_if(ROFF_ARGS)
Line 402  roff_if(ROFF_ARGS)
          * It's good enough for now, however.           * It's good enough for now, however.
          */           */
   
         if ( ! roffnode_push(r, tok, ln, ppos))  
                 return(ROFF_ERR);  
   
         while ((*bufp)[pos] && ' ' != (*bufp)[pos])          while ((*bufp)[pos] && ' ' != (*bufp)[pos])
                 pos++;                  pos++;
   
           sv = pos;
         while (' ' == (*bufp)[pos])          while (' ' == (*bufp)[pos])
                 pos++;                  pos++;
   
           /*
            * Roff is weird.  If we have just white-space after the
            * conditional, it's considered the BODY and we exit without
            * really doing anything.  Warn about this.  It's probably
            * wrong.
            */
   
           if ('\0' == (*bufp)[pos] && sv != pos) {
                   if ( ! (*r->msg)(MANDOCERR_NOARGS, r->data, ln, ppos, NULL))
                           return(ROFF_ERR);
                   return(ROFF_IGN);
           }
   
           if ( ! roffnode_push(r, tok, ln, ppos))
                   return(ROFF_ERR);
   
         /* Don't evaluate: just assume NO. */          /* Don't evaluate: just assume NO. */
   
         r->last->endspan = 1;          r->last->endspan = 1;
Line 418  roff_if(ROFF_ARGS)
Line 436  roff_if(ROFF_ARGS)
         } else          } else
                 ROFF_MDEBUG(r, "opening implicit scope");                  ROFF_MDEBUG(r, "opening implicit scope");
   
           /*
            * If there are no arguments on the line, the next-line scope is
            * assumed.
            */
   
         if ('\0' == (*bufp)[pos])          if ('\0' == (*bufp)[pos])
                 return(ROFF_IGN);                  return(ROFF_IGN);
   
           /* Otherwise re-run the roff parser after recalculating. */
   
         *offs = pos;          *offs = pos;
         return(ROFF_RERUN);          return(ROFF_RERUN);

Legend:
Removed from v.1.76  
changed lines
  Added in v.1.77

CVSweb