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

Diff for /mandoc/eqn.c between version 1.76 and 1.80

version 1.76, 2017/07/08 14:51:04 version 1.80, 2018/12/13 03:40:13
Line 31 
Line 31 
 #include "mandoc.h"  #include "mandoc.h"
 #include "roff.h"  #include "roff.h"
 #include "libmandoc.h"  #include "libmandoc.h"
 #include "libroff.h"  #include "eqn_parse.h"
   
 #define EQN_NEST_MAX     128 /* maximum nesting of defines */  #define EQN_NEST_MAX     128 /* maximum nesting of defines */
 #define STRNEQ(p1, sz1, p2, sz2) \  #define STRNEQ(p1, sz1, p2, sz2) \
Line 284  enum parse_mode {
Line 284  enum parse_mode {
         MODE_TOK          MODE_TOK
 };  };
   
   struct  eqn_def {
           char             *key;
           size_t            keysz;
           char             *val;
           size_t            valsz;
   };
   
 static  struct eqn_box  *eqn_box_alloc(struct eqn_node *, struct eqn_box *);  static  struct eqn_box  *eqn_box_alloc(struct eqn_node *, struct eqn_box *);
 static  struct eqn_box  *eqn_box_makebinary(struct eqn_node *,  static  struct eqn_box  *eqn_box_makebinary(struct eqn_node *,
                                 struct eqn_box *);                                  struct eqn_box *);
Line 468  eqn_next(struct eqn_node *ep, enum parse_mode mode)
Line 475  eqn_next(struct eqn_node *ep, enum parse_mode mode)
 void  void
 eqn_box_free(struct eqn_box *bp)  eqn_box_free(struct eqn_box *bp)
 {  {
           if (bp == NULL)
                   return;
   
         if (bp->first)          if (bp->first)
                 eqn_box_free(bp->first);                  eqn_box_free(bp->first);
Line 717  next_tok:
Line 726  next_tok:
                         parent->bottom = mandoc_strdup("\\[ul]");                          parent->bottom = mandoc_strdup("\\[ul]");
                         break;                          break;
                 case EQN_TOK_BAR:                  case EQN_TOK_BAR:
                         parent->top = mandoc_strdup("\\[rl]");                          parent->top = mandoc_strdup("\\[rn]");
                         break;                          break;
                 case EQN_TOK_DOT:                  case EQN_TOK_DOT:
                         parent->top = mandoc_strdup("\\[a.]");                          parent->top = mandoc_strdup("\\[a.]");
Line 1041  next_tok:
Line 1050  next_tok:
                                 /* No boundary after last character. */                                  /* No boundary after last character. */
                                 if (*cpn == '\0')                                  if (*cpn == '\0')
                                         break;                                          break;
                                 if (ccln == ccl)                                  if (ccln == ccl && *cp != ',' && *cpn != ',')
                                         continue;                                          continue;
                                 /* Boundary found, split the text. */                                  /* Boundary found, split the text. */
                                 if (parent->args == parent->expectargs) {                                  if (parent->args == parent->expectargs) {
Line 1091  void
Line 1100  void
 eqn_free(struct eqn_node *p)  eqn_free(struct eqn_node *p)
 {  {
         int              i;          int              i;
   
           if (p == NULL)
                   return;
   
         for (i = 0; i < (int)p->defsz; i++) {          for (i = 0; i < (int)p->defsz; i++) {
                 free(p->defs[i].key);                  free(p->defs[i].key);

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

CVSweb