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

Diff for /src/usr.bin/mandoc/read.c between version 1.111 and 1.112

version 1.111, 2015/04/18 17:01:28 version 1.112, 2015/04/18 17:28:08
Line 284 
Line 284 
                 }                  }
         }          }
   
         if (format == MPARSE_MDOC) {          if (curp->man == NULL) {
                 if (curp->man == NULL)                  curp->man = roff_man_alloc(curp->roff, curp, curp->defos,
                         curp->man = mdoc_alloc(                      curp->options & MPARSE_QUICK ? 1 : 0);
                             curp->roff, curp, curp->defos,                  curp->man->macroset = MACROSET_MAN;
                             MPARSE_QUICK & curp->options ? 1 : 0);                  curp->man->first->tok = MDOC_MAX;
                 else  
                         curp->man->macroset = MACROSET_MDOC;  
                 mdoc_hash_init();  
                 return;  
         }          }
   
         /* Fall back to man(7) as a last resort. */          if (format == MPARSE_MDOC) {
                   mdoc_hash_init();
         if (curp->man == NULL)                  curp->man->macroset = MACROSET_MDOC;
                 curp->man = man_alloc(                  curp->man->first->tok = MDOC_MAX;
                     curp->roff, curp, curp->defos,          } else {
                     MPARSE_QUICK & curp->options ? 1 : 0);                  man_hash_init();
         else  
                 curp->man->macroset = MACROSET_MAN;                  curp->man->macroset = MACROSET_MAN;
         man_hash_init();                  curp->man->first->tok = MAN_MAX;
           }
 }  }
   
 /*  /*
Line 683 
Line 679 
 {  {
   
         if (curp->man == NULL && curp->sodest == NULL)          if (curp->man == NULL && curp->sodest == NULL)
                 curp->man = man_alloc(curp->roff, curp, curp->defos,                  curp->man = roff_man_alloc(curp->roff, curp, curp->defos,
                     curp->options & MPARSE_QUICK ? 1 : 0);                      curp->options & MPARSE_QUICK ? 1 : 0);
         if (curp->man->macroset == MACROSET_NONE)          if (curp->man->macroset == MACROSET_NONE)
                 curp->man->macroset = MACROSET_MAN;                  curp->man->macroset = MACROSET_MAN;
Line 870 
Line 866 
   
         curp->mchars = mchars;          curp->mchars = mchars;
         curp->roff = roff_alloc(curp, curp->mchars, options);          curp->roff = roff_alloc(curp, curp->mchars, options);
           curp->man = roff_man_alloc( curp->roff, curp, curp->defos,
                   curp->options & MPARSE_QUICK ? 1 : 0);
         if (curp->options & MPARSE_MDOC) {          if (curp->options & MPARSE_MDOC) {
                 curp->man = mdoc_alloc(  
                     curp->roff, curp, curp->defos,  
                     curp->options & MPARSE_QUICK ? 1 : 0);  
                 mdoc_hash_init();                  mdoc_hash_init();
         }                  curp->man->macroset = MACROSET_MDOC;
         if (curp->options & MPARSE_MAN) {                  curp->man->first->tok = MDOC_MAX;
                 curp->man = man_alloc(          } else if (curp->options & MPARSE_MAN) {
                     curp->roff, curp, curp->defos,  
                     curp->options & MPARSE_QUICK ? 1 : 0);  
                 man_hash_init();                  man_hash_init();
                   curp->man->macroset = MACROSET_MAN;
                   curp->man->first->tok = MAN_MAX;
         }          }
   
         return(curp);          return(curp);
 }  }
   
Line 892 
Line 886 
   
         roff_reset(curp->roff);          roff_reset(curp->roff);
   
         if (curp->man != NULL) {          if (curp->man != NULL)
                 if (curp->man->macroset == MACROSET_MDOC)                  roff_man_reset(curp->man);
                         mdoc_reset(curp->man);  
                 else  
                         man_reset(curp->man);  
                 curp->man->macroset = MACROSET_NONE;  
         }  
         if (curp->secondary)          if (curp->secondary)
                 curp->secondary->sz = 0;                  curp->secondary->sz = 0;
   
Line 912 
Line 901 
 mparse_free(struct mparse *curp)  mparse_free(struct mparse *curp)
 {  {
   
         if (curp->man->macroset == MACROSET_MDOC)          roff_man_free(curp->man);
                 mdoc_free(curp->man);  
         if (curp->man->macroset == MACROSET_MAN)  
                 man_free(curp->man);  
         if (curp->roff)          if (curp->roff)
                 roff_free(curp->roff);                  roff_free(curp->roff);
         if (curp->secondary)          if (curp->secondary)

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