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

Diff for /mandoc/demandoc.c between version 1.23 and 1.27

version 1.23, 2015/10/20 02:01:31 version 1.27, 2016/07/09 15:24:19
Line 20 
Line 20 
   
 #include <assert.h>  #include <assert.h>
 #include <ctype.h>  #include <ctype.h>
 #include <getopt.h>  
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
Line 87  main(int argc, char *argv[])
Line 86  main(int argc, char *argv[])
   
         for (i = 0; i < argc; i++) {          for (i = 0; i < argc; i++) {
                 mparse_reset(mp);                  mparse_reset(mp);
                 if (mparse_open(mp, &fd, argv[i]) != MANDOCLEVEL_OK) {                  if ((fd = mparse_open(mp, argv[i])) == -1) {
                         perror(argv[i]);                          perror(argv[i]);
                         continue;                          continue;
                 }                  }
Line 113  pmandoc(struct mparse *mp, int fd, const char *fn, int
Line 112  pmandoc(struct mparse *mp, int fd, const char *fn, int
         int              line, col;          int              line, col;
   
         mparse_readfd(mp, fd, fn);          mparse_readfd(mp, fd, fn);
           close(fd);
         mparse_result(mp, &man, NULL);          mparse_result(mp, &man, NULL);
         line = 1;          line = 1;
         col = 0;          col = 0;
Line 122  pmandoc(struct mparse *mp, int fd, const char *fn, int
Line 122  pmandoc(struct mparse *mp, int fd, const char *fn, int
         if (man->macroset == MACROSET_MDOC) {          if (man->macroset == MACROSET_MDOC) {
                 mdoc_validate(man);                  mdoc_validate(man);
                 pmdoc(man->first->child, &line, &col, list);                  pmdoc(man->first->child, &line, &col, list);
         } else          } else {
                   man_validate(man);
                 pman(man->first->child, &line, &col, list);                  pman(man->first->child, &line, &col, list);
           }
   
         if ( ! list)          if ( ! list)
                 putchar('\n');                  putchar('\n');

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.27

CVSweb