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

Diff for /src/usr.bin/compress/main.c between version 1.82 and 1.83

version 1.82, 2014/10/08 03:59:11 version 1.83, 2015/01/16 06:40:06
Line 30 
Line 30 
  * THE POSSIBILITY OF SUCH DAMAGE.   * THE POSSIBILITY OF SUCH DAMAGE.
  */   */
   
 #include <sys/param.h>  
 #include <sys/time.h>  #include <sys/time.h>
 #include <sys/stat.h>  #include <sys/stat.h>
   
Line 44 
Line 43 
 #include <stdbool.h>  #include <stdbool.h>
 #include <string.h>  #include <string.h>
 #include <unistd.h>  #include <unistd.h>
   #include <limits.h>
 #include <fcntl.h>  #include <fcntl.h>
 #include <paths.h>  #include <paths.h>
 #include "compress.h"  #include "compress.h"
Line 164 
Line 164 
         const struct compressor *method;          const struct compressor *method;
         const char *optstr, *s;          const char *optstr, *s;
         char *p, *infile;          char *p, *infile;
         char outfile[MAXPATHLEN], _infile[MAXPATHLEN], suffix[16];          char outfile[PATH_MAX], _infile[PATH_MAX], suffix[16];
         int bits, ch, error, rc, cflag, oflag;          int bits, ch, error, rc, cflag, oflag;
   
         bits = cflag = oflag = 0;          bits = cflag = oflag = 0;
Line 613 
Line 613 
     int bits, struct stat *sb)      int bits, struct stat *sb)
 {  {
         u_char buf[Z_BUFSIZE];          u_char buf[Z_BUFSIZE];
         char oldname[MAXPATHLEN];          char oldname[PATH_MAX];
         int error, oreg, ifd, ofd;          int error, oreg, ifd, ofd;
         void *cookie;          void *cookie;
         ssize_t nr;          ssize_t nr;
Line 661 
Line 661 
                 char *cp = strrchr(out, '/');                  char *cp = strrchr(out, '/');
                 if (cp != NULL) {                  if (cp != NULL) {
                         *(cp + 1) = '\0';                          *(cp + 1) = '\0';
                         strlcat(out, oldname, MAXPATHLEN);                          strlcat(out, oldname, PATH_MAX);
                 } else                  } else
                         strlcpy(out, oldname, MAXPATHLEN);                          strlcpy(out, oldname, PATH_MAX);
                 cat = 0;                        /* XXX should -c override? */                  cat = 0;                        /* XXX should -c override? */
         }          }
   

Legend:
Removed from v.1.82  
changed lines
  Added in v.1.83