From owner-freebsd-bugs@FreeBSD.ORG Mon Jun 16 07:10:16 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 D6C9537B401 for ; Mon, 16 Jun 2003 07:10:16 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id AAEE643FBF for ; Mon, 16 Jun 2003 07:10:15 -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 h5GEAFUp051361 for ; Mon, 16 Jun 2003 07:10:15 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h5GEAFKi051360; Mon, 16 Jun 2003 07:10:15 -0700 (PDT) Resent-Date: Mon, 16 Jun 2003 07:10:15 -0700 (PDT) Resent-Message-Id: <200306161410.h5GEAFKi051360@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Gil Kloepfer Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B01BE37B401 for ; Mon, 16 Jun 2003 07:06:56 -0700 (PDT) Received: from ns2.arlut.utexas.edu (ns2.arlut.utexas.edu [129.116.174.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD7F643FBF for ; Mon, 16 Jun 2003 07:06:55 -0700 (PDT) (envelope-from gil@arlut.utexas.edu) Received: from ns5.arlut.utexas.edu (ns5.arlut.utexas.edu [10.4.1.6]) by ns2.arlut.utexas.edu (8.12.9/8.12.9) with ESMTP id h5GE6tTQ005321 for ; Mon, 16 Jun 2003 09:06:55 -0500 (CDT) Received: from csdlap3.arlut.utexas.edu (csdlap3.arlut.utexas.edu [10.3.16.8]) by ns5.arlut.utexas.edu (8.12.9/8.12.9) with ESMTP id h5GE6sK8063368; Mon, 16 Jun 2003 09:06:54 -0500 (CDT) Received: from csdlap3.arlut.utexas.edu (localhost.arlut.utexas.edu [127.0.0.1])h5GE6sri083153; Mon, 16 Jun 2003 09:06:54 -0500 (CDT) Received: (from gil@localhost)h5GE6sCl083152; Mon, 16 Jun 2003 09:06:54 -0500 (CDT) Message-Id: <200306161406.h5GE6sCl083152@csdlap3.arlut.utexas.edu> Date: Mon, 16 Jun 2003 09:06:54 -0500 (CDT) From: Gil Kloepfer To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/53375: pkg_info does not display index properly X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Gil Kloepfer List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2003 14:10:17 -0000 >Number: 53375 >Category: bin >Synopsis: pkg_info does not display index properly >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jun 16 07:10:15 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Gil Kloepfer >Release: FreeBSD 4.8-RELEASE i386 >Organization: UT Applied Research Laboratories >Environment: System: FreeBSD csdlap3.arlut.utexas.edu 4.8-RELEASE FreeBSD 4.8-RELEASE #0: Thu Jun 12 17:06:10 CDT 2003 gil@csdlap3.arlut.utexas.edu:/usr/src/sys/compile/ARLINSP8K i386 >Description: pkg_info with no args (index) does not print a newline at the end of each package. This causes the entire package list to be displayed as one line. >How-To-Repeat: Install the following three packages on a clean system: compat3x-i386-4.4.20020925 javavmwrapper-1.4 jre-1.1.8 Then type pkg_info. >Fix: Apply the following patch to /usr/src/usr.sbin/pkg_install/info/show.c: -- Cut Here -- -- Cut Here -- -- Cut Here -- -- Cut Here -- -- Cut Here -- --- show.c Mon Jun 16 08:57:41 2003 +++ show.c.ORIG Tue Aug 20 01:35:08 2002 @@ -54,7 +54,6 @@ { FILE *fp; char line[MAXINDEXSIZE+2]; - int lastc; if (!Quiet) printf("%s%s", InfoPrefix, title); @@ -64,13 +63,11 @@ return; } if(fgets(line, MAXINDEXSIZE+1, fp)) { - line[MAXINDEXSIZE+1] = 0; + if(line[MAXINDEXSIZE-1] != '\n') + line[MAXINDEXSIZE] = '\n'; + line[MAXINDEXSIZE+1] = 0; fputs(line, stdout); - lastc = strlen(line); - if(lastc > 0 && line[lastc-1] != '\n') - putchar('\n'); - } else - putchar('\n'); + } fclose(fp); } -- Cut Here -- -- Cut Here -- -- Cut Here -- -- Cut Here -- -- Cut Here -- Note that this patch also fixes the case where no lines can be read from the package file (the newline would also be missing). >Release-Note: >Audit-Trail: >Unformatted: