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

Diff for /mandoc/read.c between version 1.209 and 1.211

version 1.209, 2018/12/30 00:49:55 version 1.211, 2019/01/11 17:04:44
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010-2018 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2010-2019 Ingo Schwarze <schwarze@openbsd.org>
  * Copyright (c) 2010, 2012 Joerg Sonnenberger <joerg@netbsd.org>   * Copyright (c) 2010, 2012 Joerg Sonnenberger <joerg@netbsd.org>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
Line 607  int
Line 607  int
 mparse_open(struct mparse *curp, const char *file)  mparse_open(struct mparse *curp, const char *file)
 {  {
         char             *cp;          char             *cp;
         int               fd;          int               fd, save_errno;
   
         cp = strrchr(file, '.');          cp = strrchr(file, '.');
         curp->gzip = (cp != NULL && ! strcmp(cp + 1, "gz"));          curp->gzip = (cp != NULL && ! strcmp(cp + 1, "gz"));
Line 623  mparse_open(struct mparse *curp, const char *file)
Line 623  mparse_open(struct mparse *curp, const char *file)
          */           */
   
         if ( ! curp->gzip) {          if ( ! curp->gzip) {
                   save_errno = errno;
                 mandoc_asprintf(&cp, "%s.gz", file);                  mandoc_asprintf(&cp, "%s.gz", file);
                 fd = open(cp, O_RDONLY);                  fd = open(cp, O_RDONLY);
                 free(cp);                  free(cp);
                   errno = save_errno;
                 if (fd != -1) {                  if (fd != -1) {
                         curp->gzip = 1;                          curp->gzip = 1;
                         return fd;                          return fd;
Line 688  mparse_free(struct mparse *curp)
Line 690  mparse_free(struct mparse *curp)
 struct roff_meta *  struct roff_meta *
 mparse_result(struct mparse *curp)  mparse_result(struct mparse *curp)
 {  {
           roff_state_reset(curp->man);
         if (curp->options & MPARSE_VALIDATE) {          if (curp->options & MPARSE_VALIDATE) {
                 if (curp->man->meta.macroset == MACROSET_MDOC)                  if (curp->man->meta.macroset == MACROSET_MDOC)
                         mdoc_validate(curp->man);                          mdoc_validate(curp->man);

Legend:
Removed from v.1.209  
changed lines
  Added in v.1.211

CVSweb