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

Diff for /mandoc/main.c between version 1.351 and 1.352

version 1.351, 2020/07/20 16:57:30 version 1.352, 2020/07/21 15:10:01
Line 165  main(int argc, char *argv[])
Line 165  main(int argc, char *argv[])
                 return mandocdb(argc, argv);                  return mandocdb(argc, argv);
   
 #if HAVE_PLEDGE  #if HAVE_PLEDGE
         if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1) {          if (pledge("stdio rpath wpath cpath tmppath tty proc exec", NULL) == -1) {
                 mandoc_msg(MANDOCERR_PLEDGE, 0, 0, "%s", strerror(errno));                  mandoc_msg(MANDOCERR_PLEDGE, 0, 0, "%s", strerror(errno));
                 return mandoc_msg_getrc();                  return mandoc_msg_getrc();
         }          }
Line 373  main(int argc, char *argv[])
Line 373  main(int argc, char *argv[])
   
         if (outmode == OUTMODE_FLN ||          if (outmode == OUTMODE_FLN ||
             outmode == OUTMODE_LST ||              outmode == OUTMODE_LST ||
             !isatty(STDOUT_FILENO))              (conf.output.outfilename == NULL &&
                conf.output.tagfilename == NULL &&
                isatty(STDOUT_FILENO) == 0))
                 outst.use_pager = 0;                  outst.use_pager = 0;
   
         if (outst.use_pager &&          if (outst.use_pager &&
Line 387  main(int argc, char *argv[])
Line 389  main(int argc, char *argv[])
         }          }
   
 #if HAVE_PLEDGE  #if HAVE_PLEDGE
         if (outst.use_pager == 0) {          if (outst.use_pager == 0)
                 if (pledge("stdio rpath", NULL) == -1) {                  c = pledge("stdio rpath", NULL);
                         mandoc_msg(MANDOCERR_PLEDGE, 0, 0,          else if (conf.output.outfilename != NULL ||
                             "%s", strerror(errno));              conf.output.tagfilename != NULL)
                         return mandoc_msg_getrc();                  c = pledge("stdio rpath wpath cpath", NULL);
                 }          else
                   c = pledge("stdio rpath tmppath tty proc exec", NULL);
           if (c == -1) {
                   mandoc_msg(MANDOCERR_PLEDGE, 0, 0, "%s", strerror(errno));
                   return mandoc_msg_getrc();
         }          }
 #endif  #endif
   
Line 642  out:
Line 648  out:
                 manconf_free(&conf);                  manconf_free(&conf);
   
         if (outst.tag_files != NULL) {          if (outst.tag_files != NULL) {
                 if (term_tag_close() != -1)                  if (term_tag_close() != -1 &&
                       conf.output.outfilename == NULL &&
                       conf.output.tagfilename == NULL)
                         run_pager(&outst, conf.output.tag);                          run_pager(&outst, conf.output.tag);
                 term_tag_unlink();                  term_tag_unlink();
         } else if (outst.had_output && outst.outtype != OUTT_LINT)          } else if (outst.had_output && outst.outtype != OUTT_LINT)
Line 837  process_onefile(struct mparse *mp, struct manpage *res
Line 845  process_onefile(struct mparse *mp, struct manpage *res
   
         if (outst->use_pager) {          if (outst->use_pager) {
                 outst->use_pager = 0;                  outst->use_pager = 0;
                 outst->tag_files = term_tag_init();                  outst->tag_files = term_tag_init(conf->output.outfilename,
                       conf->output.tagfilename);
                   if ((conf->output.outfilename != NULL ||
                        conf->output.tagfilename != NULL) &&
                       pledge("stdio rpath cpath", NULL) == -1) {
                           mandoc_msg(MANDOCERR_PLEDGE, 0, 0,
                               "%s", strerror(errno));
                           exit(mandoc_msg_getrc());
                   }
         }          }
         if (outst->had_output && outst->outtype <= OUTT_UTF8) {          if (outst->had_output && outst->outtype <= OUTT_UTF8) {
                 if (outst->outdata == NULL)                  if (outst->outdata == NULL)

Legend:
Removed from v.1.351  
changed lines
  Added in v.1.352

CVSweb