summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-10-20 22:13:11 +0000
committerschwarze <schwarze@openbsd.org>2014-10-20 22:13:11 +0000
commit7fd3417530c6c6d0683abaca81ceb3d87d85c3dc (patch)
tree56e08a0e8c93aa53a9df13a5c1e3b5f5d570fc1c
parentList extensions in the STANDARDS section, replacing some text below CAVEATS. (diff)
downloadwireguard-openbsd-7fd3417530c6c6d0683abaca81ceb3d87d85c3dc.tar.xz
wireguard-openbsd-7fd3417530c6c6d0683abaca81ceb3d87d85c3dc.zip
fix a regression that i caused in rev. 1.26: *do* report the size of
files listed on the command line, no matter what options are given; issue reported by edd@; ok millert@ edd@
-rw-r--r--usr.bin/du/du.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c
index e020813f9f0..ce223066ce2 100644
--- a/usr.bin/du/du.c
+++ b/usr.bin/du/du.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: du.c,v 1.28 2014/10/19 18:24:58 jmc Exp $ */
+/* $OpenBSD: du.c,v 1.29 2014/10/20 22:13:11 schwarze Exp $ */
/* $NetBSD: du.c,v 1.11 1996/10/18 07:20:35 thorpej Exp $ */
/*
@@ -193,7 +193,8 @@ main(int argc, char *argv[])
* If listing each file, or a non-directory file was
* the root of a traversal, display the total.
*/
- if (listfiles && p->fts_level <= maxdepth)
+ if ((listfiles && p->fts_level <= maxdepth) ||
+ p->fts_level == FTS_ROOTLEVEL)
prtout(howmany(p->fts_statp->st_blocks,
blocksize), p->fts_path, hflag);
p->fts_parent->fts_number += p->fts_statp->st_blocks;