version 1.82, 2014/10/08 03:59:11 |
version 1.83, 2015/01/16 06:40:06 |
|
|
* 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> |
|
|
|
|
#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" |
|
|
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; |
|
|
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; |
|
|
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? */ |
} |
} |
|
|