From owner-freebsd-bugs@FreeBSD.ORG Fri May 16 02:20:13 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BAE0337B401 for ; Fri, 16 May 2003 02:20:13 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4302543FBD for ; Fri, 16 May 2003 02:20:13 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h4G9KDUp096487 for ; Fri, 16 May 2003 02:20:13 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h4G9KDcs096486; Fri, 16 May 2003 02:20:13 -0700 (PDT) Date: Fri, 16 May 2003 02:20:13 -0700 (PDT) Message-Id: <200305160920.h4G9KDcs096486@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Ruslan Ermilov Subject: Re: bin/52213: catman compresses with wrong program if source files are uncompressed X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Ruslan Ermilov List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2003 09:20:14 -0000 The following reply was made to PR bin/52213; it has been noted by GNATS. From: Ruslan Ermilov To: Krister Joas Cc: bug-followup@FreeBSD.org Subject: Re: bin/52213: catman compresses with wrong program if source files are uncompressed Date: Fri, 16 May 2003 12:09:39 +0300 On Wed, May 14, 2003 at 07:24:05PM +0900, Krister Joas wrote: > > The following patch fixes catman so that if the source file is > compressed the preformatted files are compressed with the same > program as the source and if the source files are uncompressed the > preformatted files are also uncompressed. > I've cleaned up your patch a bit. %%% Index: catman.c =================================================================== RCS file: /home/ncvs/src/usr.bin/catman/catman.c,v retrieving revision 1.5 diff -u -p -r1.5 catman.c --- catman.c 29 Oct 2002 09:20:22 -0000 1.5 +++ catman.c 16 May 2003 09:03:22 -0000 @@ -84,7 +84,7 @@ static const char *locale_device[] = { #define BZ2_CMD "bzip2" #define BZ2_EXT ".bz2" #define BZ2CAT_CMD "bz" -#define GZ_CMD "gzip -n" +#define GZ_CMD "gzip" #define GZ_EXT ".gz" #define GZCAT_CMD "z" enum Ziptype {NONE, BZIP, GZIP}; @@ -461,9 +461,11 @@ process_page(char *mandir, char *src, ch } snprintf(tmp_file, sizeof tmp_file, "%s.tmp", cat); snprintf(cmd, sizeof cmd, - "%scat %s | tbl | nroff -T%s -man | col | %s -c > %s.tmp", + "%scat %s | tbl | nroff -T%s -man | col | %s > %s.tmp", zipped == BZIP ? BZ2CAT_CMD : zipped == GZIP ? GZCAT_CMD : "", - src, nroff_device, zipped == GZIP ? GZ_CMD : BZ2_CMD, cat); + src, nroff_device, + zipped == BZIP ? BZ2_CMD : zipped == GZIP ? GZ_CMD : "cat", + cat); if (system(cmd) != 0) err(1, "formatting pipeline"); if (rename(tmp_file, cat) < 0) @@ -541,11 +543,11 @@ scan_section(char *mandir, char *section "warning, %s is uncompressed\n", page_path); } - snprintf(cat_path, sizeof cat_path, "%s/%s%s", - cat_section, page_name, GZ_EXT); + snprintf(cat_path, sizeof cat_path, "%s/%s", + cat_section, page_name); if (expected != NULL) { asprintf(&expected[nexpected++], - "%s%s", page_name, GZ_EXT); + "%s", page_name); } process_page(mandir, page_path, cat_path, NONE); } %%% -- Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age