From owner-freebsd-bugs Fri Sep 11 07:10:09 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA05114 for freebsd-bugs-outgoing; Fri, 11 Sep 1998 07:10:09 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA05091 for ; Fri, 11 Sep 1998 07:10:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id HAA29456; Fri, 11 Sep 1998 07:10:01 -0700 (PDT) Received: from k6n1.znh.org (dialup2.gaffaneys.com [208.155.161.52]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA04454 for ; Fri, 11 Sep 1998 07:00:56 -0700 (PDT) (envelope-from zach@gaffaneys.com) Received: (from zach@localhost) by k6n1.znh.org (8.9.1/8.9.1) id OAA09530; Fri, 11 Sep 1998 14:01:20 GMT (envelope-from zach) Message-Id: <199809111401.OAA09530@k6n1.znh.org> Date: Fri, 11 Sep 1998 14:01:20 GMT From: Zach Heilig Reply-To: zach@gaffaneys.com To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/7896: du -c gets totals wrong... Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 7896 >Category: bin >Synopsis: du -c gets totals wrong >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: Fri Sep 11 07:10:01 PDT 1998 >Last-Modified: >Originator: Zach Heilig >Organization: none >Release: FreeBSD 3.0-CURRENT i386 (& FreeBSD 2.2.7-STABLE i386) >Environment: >Description: du -c simply puts out the numbers in the last directory visited. >How-To-Repeat: [before fix:] $ cd /usr/src/bin $ du -c ed ls 4 ed/CVS 10 ed/test/CVS 165 ed/test 290 ed 4 ls/CVS 60 ls 60 total $ [after fix:] $ cd /usr/src/bin $ du -c ed ls 4 ed/CVS 10 ed/test/CVS 165 ed/test 290 ed 4 ls/CVS 60 ls 350 total $ >Fix: Both -stable and -current need this fix: Index: du.c =================================================================== RCS file: /fs/ncvs/src/usr.bin/du/du.c,v retrieving revision 1.12 diff -u -r1.12 du.c --- du.c 1998/07/29 17:50:06 1.12 +++ du.c 1998/09/11 13:50:48 @@ -214,7 +214,7 @@ p->fts_parent->fts_number += p->fts_statp->st_blocks; } - savednumber = p->fts_number; + savednumber = p->fts_parent->fts_number; } if (errno) >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message