diff options
| author | Maxim Sobolev <sobomax@FreeBSD.org> | 2001-10-18 11:35:54 +0000 |
|---|---|---|
| committer | Maxim Sobolev <sobomax@FreeBSD.org> | 2001-10-18 11:35:54 +0000 |
| commit | 79726087e478918083a9840c85f4aa95a75d4895 (patch) | |
| tree | 88f1af0630d3d47ff2ad48b9e4b16d60228e4c93 /lib/libstand | |
| parent | 848249f737ddaf820e16e0f310769b6043b6a9ad (diff) | |
Notes
Diffstat (limited to 'lib/libstand')
| -rw-r--r-- | lib/libstand/Makefile | 11 | ||||
| -rw-r--r-- | lib/libstand/bzipfs.c | 6 | ||||
| -rw-r--r-- | lib/libstand/libstand.3 | 2 | ||||
| -rw-r--r-- | lib/libstand/stand.h | 1 | ||||
| -rw-r--r-- | lib/libstand/zipfs.c | 5 |
5 files changed, 19 insertions, 6 deletions
diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile index ff809f395210..a9a8e74b2077 100644 --- a/lib/libstand/Makefile +++ b/lib/libstand/Makefile @@ -96,6 +96,15 @@ SRCS+= _setjmp.S # really only required for i386 CFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH} +# decompression functionality from libbz2 +.PATH: ${.CURDIR}/../../contrib/bzip2 +CFLAGS+=-I${.CURDIR}/../../contrib/bzip2 -DBZ_NO_STDIO -DBZ_NO_COMPRESS +SRCS+= _bzlib.c crctable.c decompress.c huffman.c randtable.c +CLEANFILES+= _bzlib.c _bzlib.c.orig + +_bzlib.c: bzlib.c bzlib.c.diff + patch -s -b .orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.c} + # decompression functionality from libz .PATH: ${.CURDIR}/../libz CFLAGS+=-DHAVE_MEMCPY @@ -113,7 +122,7 @@ SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c SRCS+= bootp.c rarp.c bootparam.c # boot filesystems -SRCS+= ufs.c nfs.c cd9660.c tftp.c zipfs.c +SRCS+= ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c SRCS+= netif.c nfs.c SRCS+= dosfs.c ext2fs.c diff --git a/lib/libstand/bzipfs.c b/lib/libstand/bzipfs.c index 88b7940924a0..749ea9d76e6e 100644 --- a/lib/libstand/bzipfs.c +++ b/lib/libstand/bzipfs.c @@ -23,11 +23,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ + * */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include "stand.h" #include <sys/stat.h> diff --git a/lib/libstand/libstand.3 b/lib/libstand/libstand.3 index dba6ef7fe6f7..c4310e691b2a 100644 --- a/lib/libstand/libstand.3 +++ b/lib/libstand/libstand.3 @@ -601,6 +601,8 @@ files. It is only possible to seek a gzipped file forwards, and and .Fn fstat on gzipped files will report an invalid length. +.It bzipfs_fsops +The same as zipfs_fsops, but for bzip2-compressed files. .El .Pp The array of diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h index 72b9a805f146..b679b811dd27 100644 --- a/lib/libstand/stand.h +++ b/lib/libstand/stand.h @@ -122,6 +122,7 @@ extern struct fs_ops tftp_fsops; extern struct fs_ops nfs_fsops; extern struct fs_ops cd9660_fsops; extern struct fs_ops zipfs_fsops; +extern struct fs_ops bzipfs_fsops; extern struct fs_ops dosfs_fsops; extern struct fs_ops ext2fs_fsops; diff --git a/lib/libstand/zipfs.c b/lib/libstand/zipfs.c index 61e72154b767..c95621cc6d9d 100644 --- a/lib/libstand/zipfs.c +++ b/lib/libstand/zipfs.c @@ -173,8 +173,9 @@ zf_open(const char *fname, struct open_file *f) if (f->f_flags != F_READ) return(EPERM); - /* If the name already ends in .gz, ignore it */ - if ((cp = strrchr(fname, '.')) && !strcmp(cp, ".gz")) + /* If the name already ends in .gz or .bz2, ignore it */ + if ((cp = strrchr(fname, '.')) && (!strcmp(cp, ".gz") + || !strcmp(cp, ".bz2"))) return(ENOENT); /* Construct new name */ |
