NetBSD Problem Report #513

From gnats  Tue Oct 11 20:23:50 1994
Received: from relay3.UU.NET (relay3.UU.NET [192.48.96.8]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id UAA24562 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Tue, 11 Oct 1994 20:23:49 -0700
Message-Id: <199410120119.VAA21608@anduin.eldar.org>
Date: Tue, 11 Oct 1994 21:19:50 -0400
From: Brad Spencer <brad@anduin.eldar.org>
Reply-To: brad@anduin.eldar.org
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: -b appears to be ignored with the standard compresser
X-Send-Pr-Version: 3.2

>Number:         513
>Category:       bin
>Synopsis:       -b appears to be ignored with the standard compresser
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 11 20:35:03 +0000 1994
>Closed-Date:    Wed Oct 12 11:16:17 +0000 1994
>Last-Modified:  
>Originator:     Brad Spencer
>Release:        
>Organization:
"	Just sitt'n around at home"
>Environment:
	Pentium 90mhz, i386 port a couple of week old, "standard" libraries
System: NetBSD anduin.eldar.org 1.0_BETA NetBSD 1.0_BETA (ANDUIN) #10: Mon Sep 26 18:34:12 EDT 1994 brad@anduin.eldar.org:/usr/src/sys/arch/i386/compile/ANDUIN i386


>Description:
	The standard Unix compresser doesn't appear to be able to compress
	anything except with 16 bits.
>How-To-Repeat:
	compress -b12 foo
	file foo
	'foo' will report as a 16 bit compressed file
>Fix:
	I don't fully understand the compress code, but here is a fix
	that I tested with compress on SunOS.  It appears that the BITS
	define was not used correctly in this case.

*** zopen.c.orig	Tue Oct 11 20:52:56 1994
--- zopen.c	Tue Oct 11 20:47:24 1994
***************
*** 255,265 ****
  		goto middle;
  	state = S_MIDDLE;

! 	maxmaxcode = 1L << BITS;
  	if (fwrite(magic_header,
  	    sizeof(char), sizeof(magic_header), fp) != sizeof(magic_header))
  		return (-1);
! 	tmp = (u_char)(BITS | block_compress);
  	if (fwrite(&tmp, sizeof(char), sizeof(tmp), fp) != sizeof(tmp))
  		return (-1);

--- 255,265 ----
  		goto middle;
  	state = S_MIDDLE;

! 	maxmaxcode = 1L << maxbits;
  	if (fwrite(magic_header,
  	    sizeof(char), sizeof(magic_header), fp) != sizeof(magic_header))
  		return (-1);
! 	tmp = (u_char)(maxbits | block_compress);
  	if (fwrite(&tmp, sizeof(char), sizeof(tmp), fp) != sizeof(tmp))
  		return (-1);

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mycroft 
State-Changed-When: Wed Oct 12 04:16:17 PDT 1994 
State-Changed-Why:  
Already fixed. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.