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

Diff for /mandoc/read.c between version 1.191 and 1.193

version 1.191, 2017/07/08 17:52:50 version 1.193, 2017/11/10 23:32:40
Line 24 
Line 24 
   
 #include <assert.h>  #include <assert.h>
 #include <ctype.h>  #include <ctype.h>
 #if HAVE_ERR  
 #include <err.h>  
 #endif  
 #include <errno.h>  #include <errno.h>
 #include <fcntl.h>  #include <fcntl.h>
 #include <stdarg.h>  #include <stdarg.h>
Line 99  static const char * const mandocerrs[MANDOCERR_MAX] = 
Line 96  static const char * const mandocerrs[MANDOCERR_MAX] = 
         "legacy man(7) date format",          "legacy man(7) date format",
         "lower case character in document title",          "lower case character in document title",
         "duplicate RCS id",          "duplicate RCS id",
         "typo in section name",          "possible typo in section name",
         "unterminated quoted argument",          "unterminated quoted argument",
         "useless macro",          "useless macro",
         "consider using OS macro",          "consider using OS macro",
Line 560  read_whole_file(struct mparse *curp, const char *file,
Line 557  read_whole_file(struct mparse *curp, const char *file,
         size_t           off;          size_t           off;
         ssize_t          ssz;          ssize_t          ssz;
   
         if (fstat(fd, &st) == -1)          if (fstat(fd, &st) == -1) {
                 err((int)MANDOCLEVEL_SYSERR, "%s", file);                  mandoc_vmsg(MANDOCERR_FILE, curp, 0, 0,
                       "fstat: %s", strerror(errno));
                   return 0;
           }
   
         /*          /*
          * If we're a regular file, try just reading in the whole entry           * If we're a regular file, try just reading in the whole entry
Line 583  read_whole_file(struct mparse *curp, const char *file,
Line 583  read_whole_file(struct mparse *curp, const char *file,
         }          }
   
         if (curp->gzip) {          if (curp->gzip) {
                 if ((gz = gzdopen(fd, "rb")) == NULL)                  if ((gz = gzdopen(fd, "rb")) == NULL) {
                         err((int)MANDOCLEVEL_SYSERR, "%s", file);                          mandoc_vmsg(MANDOCERR_FILE, curp, 0, 0,
                               "gzdopen: %s", strerror(errno));
                           return 0;
                   }
         } else          } else
                 gz = NULL;                  gz = NULL;
   
Line 613  read_whole_file(struct mparse *curp, const char *file,
Line 616  read_whole_file(struct mparse *curp, const char *file,
                         fb->sz = off;                          fb->sz = off;
                         return 1;                          return 1;
                 }                  }
                 if (ssz == -1)                  if (ssz == -1) {
                         err((int)MANDOCLEVEL_SYSERR, "%s", file);                          mandoc_vmsg(MANDOCERR_FILE, curp, 0, 0,
                               "read: %s", strerror(errno));
                           break;
                   }
                 off += (size_t)ssz;                  off += (size_t)ssz;
         }          }
   

Legend:
Removed from v.1.191  
changed lines
  Added in v.1.193

CVSweb