From owner-freebsd-bugs Sun Sep 9 14: 0:12 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 13D9D37B40B for ; Sun, 9 Sep 2001 14:00:07 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f89L07a16404; Sun, 9 Sep 2001 14:00:07 -0700 (PDT) (envelope-from gnats) Received: from copei.research.devcon.net (sec-01.bi.devcon.net [212.15.192.30]) by hub.freebsd.org (Postfix) with ESMTP id 2FD4637B403 for ; Sun, 9 Sep 2001 13:54:26 -0700 (PDT) Received: (from sven@localhost) by copei.research.devcon.net (8.11.6/8.11.4) id f89L74X96593; Sun, 9 Sep 2001 23:07:05 +0200 (CEST) (envelope-from sven) Message-Id: <200109092107.f89L74X96593@copei.research.devcon.net> Date: Sun, 9 Sep 2001 23:07:05 +0200 (CEST) From: Sven Klose Reply-To: sven@devcon.net To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/30467: Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 30467 >Category: bin >Synopsis: >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Sep 09 14:00:03 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Sven Klose >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD copei.research.devcon.net 5.0-CURRENT FreeBSD 5.0-CURRENT #6: Sun Sep 9 14:40:04 CEST 2001 root@copei.research.devcon.net:/usr/src/sys/i386/compile/COPEI i386 >Description: When trying to find out the maximum column width in prepfile() the element pointer ep is not initialised in case the -z option is used without -t. >How-To-Repeat: ls | rs -z >Fix: This fix inserts the missing pointer initialisation and removes misplaced debugging code. *** rs.c.orig Sun Sep 9 22:38:48 2001 --- rs.c Sun Sep 9 22:33:22 2001 *************** *** 289,312 **** colwidths[i] = max + gutter; } else ! for (i = 0; i < ocols; i++) { for (j = i; j < nelem; j += ocols) if ((n = strlen(ep[j])) > max) max = n; colwidths[i] = max + gutter; } } - /* for (i = 0; i < orows; i++) { - for (j = i; j < nelem; j += orows) - prints(ep[j], (j - i) / orows); - putchar('\n'); - } - else - for (i = 0; i < orows; i++) { - for (j = 0; j < ocols; j++) - prints(*ep++, j); - putchar('\n'); - }*/ else for (i = 0; i < ocols; i++) colwidths[i] = colw; --- 289,301 ---- colwidths[i] = max + gutter; } else ! for (ep = elem, i = 0; i < ocols; i++) { for (j = i; j < nelem; j += ocols) if ((n = strlen(ep[j])) > max) max = n; colwidths[i] = max + gutter; } } else for (i = 0; i < ocols; i++) colwidths[i] = colw; *************** *** 319,326 **** n = orows * ocols; if (n > nelem && (flags & RECYCLE)) nelem = n; - /*for (i = 0; i < ocols; i++) - warnx("%d is colwidths, nelem %d", colwidths[i], nelem);*/ } #define BSIZE 2048 --- 308,313 ---- >Release-Note: >Audit-Trail: >Unformatted: rs crashes when option -z is used without -t. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message