Deleted Added
full compact
1c1
< /* $NetBSD: gzip.c,v 1.99 2011/03/23 12:59:44 tsutsui Exp $ */
---
> /* $NetBSD: gzip.c,v 1.105 2011/08/30 23:06:00 joerg Exp $ */
34c34
< __FBSDID("$FreeBSD: head/usr.bin/gzip/gzip.c 222287 2011-05-25 18:04:11Z delphij $");
---
> __FBSDID("$FreeBSD: head/usr.bin/gzip/gzip.c 226184 2011-10-10 06:37:32Z delphij $");
79a80,82
> #ifndef NO_XZ_SUPPORT
> FT_XZ,
> #endif
99a103,108
> #ifndef NO_XZ_SUPPORT
> #include <lzma.h>
> #define XZ_SUFFIX ".xz"
> #define XZ_MAGIC "\3757zXZ"
> #endif
>
141a151,153
> #ifndef NO_XZ_SUPPORT
> SUFFIX(XZ_SUFFIX, ""),
> #endif
149c161
< static const char gzip_version[] = "FreeBSD gzip 20110523";
---
> static const char gzip_version[] = "FreeBSD gzip 20111009";
202,206c214,217
< static void maybe_err(const char *fmt, ...) __dead2
< __attribute__((__format__(__printf__, 1, 2)));
< #if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT)
< static void maybe_errx(const char *fmt, ...) __dead2
< __attribute__((__format__(__printf__, 1, 2)));
---
> static void maybe_err(const char *fmt, ...) __printflike(1, 2) __dead2;
> #if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT) || \
> !defined(NO_XZ_SUPPORT)
> static void maybe_errx(const char *fmt, ...) __printflike(1, 2) __dead2;
208,211c219,220
< static void maybe_warn(const char *fmt, ...)
< __attribute__((__format__(__printf__, 1, 2)));
< static void maybe_warnx(const char *fmt, ...)
< __attribute__((__format__(__printf__, 1, 2)));
---
> static void maybe_warn(const char *fmt, ...) __printflike(1, 2);
> static void maybe_warnx(const char *fmt, ...) __printflike(1, 2);
226,227c235,236
< static void usage(void);
< static void display_version(void);
---
> static void usage(void) __dead2;
> static void display_version(void) __dead2;
260c269,271
< int main(int, char **p);
---
> #ifndef NO_XZ_SUPPORT
> static off_t unxz(int, int, char *, size_t, off_t *);
> #endif
459c470,471
< #if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT)
---
> #if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT) || \
> !defined(NO_XZ_SUPPORT)
1124a1137,1141
> #ifndef NO_XZ_SUPPORT
> if (memcmp(buf, XZ_MAGIC, 4) == 0) /* XXX: We only have 4 bytes */
> return FT_XZ;
> else
> #endif
1372d1388
<
1449a1466
> switch (method) {
1451,1452c1468
< if (method == FT_BZIP2) {
<
---
> case FT_BZIP2:
1460c1476
< } else
---
> break;
1464c1480
< if (method == FT_Z) {
---
> case FT_Z: {
1497c1513,1514
< } else
---
> break;
> }
1501c1518
< if (method == FT_PACK) {
---
> case FT_PACK:
1508c1525
< } else
---
> break;
1510a1528,1538
> #ifndef NO_XZ_SUPPORT
> case FT_XZ:
> if (lflag) {
> maybe_warnx("no -l with xz files");
> goto lose;
> }
>
> size = unxz(fd, zfd, NULL, 0, NULL);
> break;
> #endif
>
1512c1540
< if (method == FT_UNKNOWN) {
---
> case FT_UNKNOWN:
1518c1546
< } else
---
> break;
1520c1548
< {
---
> default:
1527a1556
> break;
1700c1729,1730
< usize = zuncompress(in, stdout, (char *)header1, sizeof header1, &gsize);
---
> usize = zuncompress(in, stdout, (char *)header1,
> sizeof header1, &gsize);
1709a1740,1745
> #ifndef NO_XZ_SUPPORT
> case FT_XZ:
> usize = unxz(STDIN_FILENO, STDOUT_FILENO,
> (char *)header1, sizeof header1, &gsize);
> break;
> #endif
2077c2113
< fprintf(stderr, "%s (based on NetBSD gzip 20091011)\n", gzip_version);
---
> fprintf(stderr, "%s (based on NetBSD gzip 20111009)\n", gzip_version);
2100a2137,2139
> #ifndef NO_XZ_SUPPORT
> #include "unxz.c"
> #endif