From owner-svn-src-all@FreeBSD.ORG Sun Nov 6 21:57:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3367D106566C; Sun, 6 Nov 2011 21:57:01 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [178.63.0.170]) by mx1.freebsd.org (Postfix) with ESMTP id E29938FC0A; Sun, 6 Nov 2011 21:57:00 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 216912A28CE3; Sun, 6 Nov 2011 22:56:30 +0100 (CET) Date: Sun, 6 Nov 2011 22:56:30 +0100 From: Ed Schouten To: Alexander Best Message-ID: <20111106215630.GQ2258@hoeg.nl> References: <201111060815.pA68FIvC008341@svn.freebsd.org> <20111106204619.GA76768@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Rnz0oC2K6vQ5doJs" Content-Disposition: inline In-Reply-To: <20111106204619.GA76768@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227164 - head/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 21:57:01 -0000 --Rnz0oC2K6vQ5doJs Content-Type: multipart/mixed; boundary="zOr5JpMIiGv/Oaxu" Content-Disposition: inline --zOr5JpMIiGv/Oaxu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Alexander, * Alexander Best , 20111106 21:46: > this diff was flying around in my /usr/src, which makes some code a bit m= ore > readable. maybe this is something worth having in HEAD? Looks good. It seems we can also get rid of the `listall' variable here. The rest of the code also uses the `*flag' variables, so there's no reason why we can't just use `aflag'. Does this patch look good to you? --=20 Ed Schouten WWW: http://80386.nl/ --zOr5JpMIiGv/Oaxu Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="du.c.diff" Content-Transfer-Encoding: quoted-printable Index: usr.bin/du/du.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- usr.bin/du/du.c (revision 227263) +++ usr.bin/du/du.c (working copy) @@ -88,7 +88,6 @@ off_t savednumber, curblocks; off_t threshold, threshold_sign; int ftsoptions; - int listall; int depth; int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag; int hflag, lflag, ch, notused, rval; @@ -229,17 +228,10 @@ if (!Aflag && (cblocksize % DEV_BSIZE) !=3D 0) cblocksize =3D howmany(cblocksize, DEV_BSIZE) * DEV_BSIZE; =20 - listall =3D 0; - - if (aflag) { - if (sflag || dflag) - usage(); - listall =3D 1; - } else if (sflag) { - if (dflag) - usage(); + if (aflag + dflag + sflag > 1) + usage(); + if (sflag) depth =3D 0; - } =20 if (!*argv) { argv =3D save; @@ -320,7 +312,7 @@ howmany(p->fts_statp->st_size, cblocksize) : howmany(p->fts_statp->st_blocks, cblocksize); =20 - if (listall || p->fts_level =3D=3D 0) { + if (aflag || p->fts_level =3D=3D 0) { if (hflag) { prthumanval(curblocks); (void)printf("\t%s\n", p->fts_path); --zOr5JpMIiGv/Oaxu-- --Rnz0oC2K6vQ5doJs Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOtwKNAAoJEG5e2P40kaK7jiYP/Re7g7MrZjZgLUJEbFWPxXyD tUlF/2DXlniMbaQtxAujmzdNUe5eIAnULlqyeHJLE20GqQBqo3ML0sX8RReeAcSt FErf/ZD6s4+RDPhYFKr+/0ZoPKh+bW1qQzJ7y7igE/mo6mrUNheyvAXuEXTV6ua5 nWkNLEnxFO6nUj3LeclPrC1pPfTvvWPn/ZMCJv9giEya7cy32BsuLmT6s+Z8yOI5 2T88gO0IdWQImTNF3hur57OCnVx405xrBFX830udrAL3uTr+lnWq+Zkdl5AH+elv hHCqnlj2U/H03HOGmbMku216FRWWQ0acBPBEfFPbXIfCq8Snw1NZ4C3+PbgFOJQ3 YOYqS6Mhz//QTw8nlBCgo6ipZxuHdN28f7FeufzxN+FfbX1bYQoOG40kbw5x5n+t 1X3O+jLKkLqkUy2hPuEbEeh+LuGZbNafXoWJQrxBmX6xNaAXJcrkxWUvZ57yWLRr EawUXT1fUx6l5H3eSZZu5lLwN0L5+D3C8XdjIheXPyCvwQTjmFGHv/SLy8l71rLi mh81jOheUzp9STbcELALXWPYGwrGeyg4abvA3oDmCqRPY7OsdTrmtxmE2xRrN3VZ WaPU0LhAxT2xZFwNVY+5wd6D7+Q7Pnb3XPd5C51aZYXg+uiTHafM997C5htQJxVn qLY9VRXYK6a8qaYj0hfW =JIA4 -----END PGP SIGNATURE----- --Rnz0oC2K6vQ5doJs--