From: Christian Weisgerber Subject: Re: Regress: accommodate other ls implementations To: "Todd C. Miller" Cc: gameoftrees@openbsd.org Date: Sat, 3 Oct 2020 19:19:46 +0200 Todd C. Miller: > > accommodate ls -l implementations that print "total 0" in an empty directory > > > > Both FreeBSD and GNU ls(1) behave that way. > > This is arguably a bug in OpenBSD's ls. It certainly differs > from historical behavior. As far as I can tell from the repository histories, OpenBSD has inherited the 4.4BSD behavior. FreeBSD explicitly changed this 16 years ago in r130236, r130237: If we are asked to print the total number of blocks, do so even if we have no entries to print (either due to an empty directory or an error). This makes the -l and -s options more consistent, like Solaris and (Debian) Linux. -- Christian "naddy" Weisgerber naddy@mips.inka.de