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

Diff for /mandoc/roff.c between version 1.138 and 1.139

version 1.138, 2011/05/14 16:06:08 version 1.139, 2011/05/24 14:00:39
Line 840  roff_cond_sub(ROFF_ARGS)
Line 840  roff_cond_sub(ROFF_ARGS)
 {  {
         enum rofft       t;          enum rofft       t;
         enum roffrule    rr;          enum roffrule    rr;
           char            *ep;
   
         rr = r->last->rule;          rr = r->last->rule;
           roffnode_cleanscope(r);
   
         /*          /*
          * Clean out scope.  If we've closed ourselves, then don't           * If the macro is unknown, first check if it contains a closing
          * continue.           * delimiter `\}'.  If it does, close out our scope and return
            * the currently-scoped rule (ignore or continue).  Else, drop
            * into the currently-scoped rule.
          */           */
   
         roffnode_cleanscope(r);  
   
         if (ROFF_MAX == (t = roff_parse(r, *bufp, &pos))) {          if (ROFF_MAX == (t = roff_parse(r, *bufp, &pos))) {
                 if ('\\' == (*bufp)[pos] && '}' == (*bufp)[pos + 1])                  /*
                         return(roff_ccond                   * Jump through hoops to detect a \}, because it could
                                 (r, ROFF_ccond, bufp, szp,                   * be (say) \\}, which is something completely
                                  ln, pos, pos + 2, offs));                   * different.
                    */
                   ep = &(*bufp)[pos];
                   for ( ; NULL != (ep = strchr(ep, '\\')); ep++) {
                           ep++;
                           if ('}' != *ep)
                                   continue;
                           *--ep = '\0';
                           roff_ccond(r, ROFF_ccond, bufp, szp,
                                           ln, pos, pos + 2, offs);
                           break;
                   }
                 return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT);                  return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT);
         }          }
   
Line 863  roff_cond_sub(ROFF_ARGS)
Line 876  roff_cond_sub(ROFF_ARGS)
          * if they're either structurally required (such as loops and           * if they're either structurally required (such as loops and
          * conditionals) or a closing macro.           * conditionals) or a closing macro.
          */           */
   
         if (ROFFRULE_DENY == rr)          if (ROFFRULE_DENY == rr)
                 if ( ! (ROFFMAC_STRUCT & roffs[t].flags))                  if ( ! (ROFFMAC_STRUCT & roffs[t].flags))
                         if (ROFF_ccond != t)                          if (ROFF_ccond != t)

Legend:
Removed from v.1.138  
changed lines
  Added in v.1.139

CVSweb