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

Diff for /mandoc/roff.c between version 1.112 and 1.113

version 1.112, 2010/12/29 14:53:31 version 1.113, 2010/12/31 14:52:41
Line 86  struct roff {
Line 86  struct roff {
         struct regset   *regs; /* read/writable registers */          struct regset   *regs; /* read/writable registers */
         struct roffstr  *first_string; /* user-defined strings & macros */          struct roffstr  *first_string; /* user-defined strings & macros */
         const char      *current_string; /* value of last called user macro */          const char      *current_string; /* value of last called user macro */
         struct tbl      *tbl;          struct tbl      *first_tbl; /* first table parsed */
           struct tbl      *last_tbl; /* last table parsed */
           struct tbl      *tbl; /* current table being parsed */
 };  };
   
 struct  roffnode {  struct  roffnode {
Line 299  roffnode_push(struct roff *r, enum rofft tok, const ch
Line 301  roffnode_push(struct roff *r, enum rofft tok, const ch
 static void  static void
 roff_free1(struct roff *r)  roff_free1(struct roff *r)
 {  {
           struct tbl      *t;
   
         if (r->tbl) {          while (r->first_tbl) {
                 tbl_free(r->tbl);                  t = r->first_tbl;
                 r->tbl = NULL;                  r->first_tbl = t->next;
                   tbl_free(t);
         }          }
   
           r->first_tbl = r->last_tbl = r->tbl = NULL;
   
         while (r->last)          while (r->last)
                 roffnode_pop(r);                  roffnode_pop(r);
   
Line 1117  roff_TE(ROFF_ARGS)
Line 1123  roff_TE(ROFF_ARGS)
   
         if (NULL == r->tbl)          if (NULL == r->tbl)
                 (*r->msg)(MANDOCERR_NOSCOPE, r->data, ln, ppos, NULL);                  (*r->msg)(MANDOCERR_NOSCOPE, r->data, ln, ppos, NULL);
         else  
                 tbl_free(r->tbl);  
   
         r->tbl = NULL;          r->tbl = NULL;
         return(ROFF_IGN);          return(ROFF_IGN);
Line 1141  roff_T_(ROFF_ARGS)
Line 1145  roff_T_(ROFF_ARGS)
 static enum rofferr  static enum rofferr
 roff_TS(ROFF_ARGS)  roff_TS(ROFF_ARGS)
 {  {
           struct tbl      *t;
   
         if (r->tbl) {          if (r->tbl)
                 (*r->msg)(MANDOCERR_SCOPEBROKEN, r->data, ln, ppos, NULL);                  (*r->msg)(MANDOCERR_SCOPEBROKEN, r->data, ln, ppos, NULL);
                 tbl_reset(r->tbl);  
         } else  
                 r->tbl = tbl_alloc(r->data, r->msg);  
   
           t = tbl_alloc(r->data, r->msg);
   
           if (r->last_tbl)
                   r->last_tbl->next = t;
           else
                   r->first_tbl = r->last_tbl = t;
   
           r->tbl = r->last_tbl = t;
         return(ROFF_IGN);          return(ROFF_IGN);
 }  }
   

Legend:
Removed from v.1.112  
changed lines
  Added in v.1.113

CVSweb