summaryrefslogtreecommitdiffstats
path: root/bin/ls
Commit message (Collapse)AuthorAgeFilesLines
* Use nanoseconds and then lexicographic ordering when the seconds ofdwmalone2004-06-221-6/+42
| | | | | | | | the [acm]time are the same. I was going to use Scott's patch, but I couldn't get the style quite right, so I used a patch of my own. Submitted by: Scott Mitchell <scott+freebsd at fishballoon.org> MFC after: 3 weeks
* If we are asked to print the total number of blocks, do so even if wedas2004-06-081-12/+14
| | | | | | | | | | | | | 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. To make this happen, tweak two optimizations on the second call to display(): - Don't skip display() altogether, even if list == NULL. - Don't skip the call to the printfn in display() if we need to print the total. PR: 45723
* Remove from the printfns the assumption that dp->list != NULL. Evendas2004-06-081-2/+6
| | | | | if there are no entries, these functions may be called to print the total number of blocks (0) for consistency's sake.
* Plug small memory leak.le2004-06-031-0/+1
| | | | | | PR: bin/67392 Submitted by: Matthew Emmerton <matt@gsicomp.on.ca> MFC in: 1 week
* Use humanize_number(3).pjd2004-05-252-60/+7
| | | | Reminded by: jhb
* Punctuation.ru2004-05-161-1/+1
|
* Only add the widths together for printable characters in prn_normal();tjr2004-05-031-1/+2
| | | | unprintable characters have a "width" of -1.
* Treat filenames as multibyte character strings (according to the currenttjr2004-05-024-65/+132
| | | | | | | | | | | | | LC_CTYPE setting) when determining which characters are printable. This is an often-requested feature. Use wcwidth() to determine the number of column positions a character takes up, although there are still a few places left where we assume 1 byte = 1 column position, e.g. line-wrapping when handling the -m option. The error handling here is somewhat more complicated than usual: we do our best to show what we can of a filename in the presence of conversion errors, instead of simply aborting.
* Remove clause 3 from the UCB licenses.markm2004-04-067-28/+0
| | | | OK'ed by: imp, core
* Stop iterating over ACLs if we've already determined webmilekic2004-04-031-5/+11
| | | | | | | | | | will print them (i.e., number of successful calls to acl_get_entry() exceeds 3). This makes O(1) what was O(num_TYPE_ACCESS_ACLs). This is a slightly modified version of submitter's patch. PR: bin/65042 Submitted by: Christian S.J. Peron <maneo@bsdpro.com>
* Document incorrect handling of multibyte characters in filenames.tjr2004-03-211-1/+5
|
* Fixes to output of `ls -lh` for certain file sizes:cperciva2004-03-011-4/+4
| | | | | | | | | | | | | | | | | | | | | 1. Sizes in the range 1000 -- 1023 units require four characters width for the integer; increase the field width to accomodate this. 2. Sizes in the range 9.95 -- 10 units were being displayed as "10.0" units; adjust the logic to fix this, and now that we've got an extra character of field width, print fractional units if the size is less than 99.95 units. 3. Don't display sub-byte precision. This should mean that the following sizes are displayed: 0B .. 1023B 1.0U .. 9.9U 10.0U .. 99.9U 100U .. 1023U for values of U in "KMGTPE". PR: bin/63547 Pointy hat to: cperciva Approved by: rwatson (mentor)
* Fix alignment of size field in `ls -lh` -- the width was being computedcperciva2004-01-221-2/+2
| | | | | | | | from log[10](largest file size), but when outputting in human-friendly format the width is always at most 4. (eg. "123K", " 12K", "1.2K".) PR: bin/59320 Approved by: rwatson (mentor)
* Do something sensible if both -h and -k are given.obrien2003-12-012-0/+9
| | | | Approved by: re(scottl)
* Handle realloc() failure correctly.tjr2003-10-161-2/+5
|
* Add the -m, -w and -x options to ls's usage message.tjr2003-09-091-2/+2
| | | | | | PR: 51493 Submitted by: Walter Belgers MFC after: 1 month
* Note in STANDARDS that -gno are not (yet?) POSIX conformant.schweikh2003-08-081-1/+6
| | | | | Spotted by: harti MFC after: 3 days
* -l prints all permissions, not just owner and groupbrueffer2003-07-101-1/+1
| | | | | | PR: 54294 Submitted by: Per Hedeland <per@hedeland.org> MFC after: 3 days
* Get this area compiling with the highest WARNS= that it works with.markm2003-06-131-2/+0
| | | | | | | Obsolete WFORMAT= junk also removed where possible. OK'ed by: obrien Tested on: sparc64, alpha, i386
* df(1) and ls(1) print units in 'four or fewer' not 'three or less'.trhodes2003-05-061-1/+1
| | | | | PR: 35523 Submitted by: Tomas Svensson <tsn@gbdev.net>
* Fix a bazillion warnings. This makes almost the whole of src/bin/*markm2003-05-034-61/+59
| | | | | | WARNS=6, std=c99 clean. Tested on: i386, alpha
* When mac_from_text() fails with -Z, print "-" rather than "" so thatrwatson2003-04-261-1/+1
| | | | | | | scripts parsing ls(1) output can still count columns. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Reference maclabel(7).chris2003-01-201-1/+3
| | | | Sponsored by: DARPA, Network Associates Laboratories
* pathconf() and acl_get_file() follow links so they cannot be used totjr2002-12-191-0/+8
| | | | | | | | | determine whether a symlink has an ACL. Instead, assume that symbolic links don't have ACLs and don't bother checking. Avoids spurious ENOENT warnings when listing directories containing broken symlinks on filesystems with ACLs enabled. Pointed out by: rwatson, bde
* Improve handling of symlink targets when listing MAC labels: don'trwatson2002-12-181-6/+13
| | | | | | | | do the wrong thing when the symlink doesn't have a target, by considering !f_label in the construction of ch_options. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* mdoc(7) police: markup fixes.ru2002-11-251-6/+9
| | | | Approved by: re
* Use warn() instead of perror() or fprintf() where appropriate.tjr2002-11-062-14/+8
|
* Print a `+' character after the standard UNIX permission fields in longtjr2002-11-032-2/+73
| | | | | | | | listings if the file has an extended ACL (more than the required 3 entries). This is what Solaris and IRIX do, and what the withdrawn POSIX.2c standard required. Reviewed by: rwatson (an earlier version of the patch)
* Do not include <sys/syslimits.h> directly; it is not intended for generalwollman2002-10-271-1/+0
| | | | consumption.
* Attempt improved use of fts results: use the correct path to therwatson2002-10-241-4/+14
| | | | | | | | | | object to retrieve label information on, rather than directly consuming the fts-provided paths (none of which are quite right). This is based on the similar readlink() code, and may contain the same bugs. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Teach "ls -Z" to use the policy-agnostic MAC label interfaces ratherrwatson2002-10-247-238/+69
| | | | | | | | | | | than the LOMAC-specific interfaces for listing MAC labels. This permits ls to view MAC labels in a manner similar to getfmac, when ls is used with the -l argument. Next generation LOMAC will use the MAC Framework so should "just" work with this and other policies. Not the prettiest code in the world, but then, neither is ls(1). Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Constify, staticify, rationalise types and fix other related warnings.markm2002-10-231-8/+8
|
* Constify to squash some warnings.markm2002-10-232-2/+2
|
* Print non-printing characters in directory names, as well as file names,tjr2002-10-183-5/+9
| | | | | | | as `?' or `\ooo', depending on whether the -b or -B flags were used. PR: 43995 MFC after: 1 month
* Output "human-readable" values with a non-0 precision wheredd2002-10-181-7/+9
| | | | | | | | appropriate. Before this, a 2.9 GB file was misleadingly reported as "2G". This mostly brings unit_adjust() in line with what is in du(1). Reviewed by: jmallett Approved by: nik
* Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the structwollman2002-09-211-2/+2
| | | | | | | | | | | | | | | | hack, thereby allowing future extensions to the structure (e.g., for extended attributes) without rebreaking the ABI. FTSENT now contains a pointer to the parent stream, which fts_compar() can then take advantage of, avoiding the undefined behavior previously warned about. As a consequence of this change, the prototype of the comparison function passed to fts_open() has changed to reflect the required amount of constness for its use. All callers in the tree are updated to use the correct prototype. Comparison functions can now make use of the new parent pointer to access the new stream-specific private data pointer, which is intended to assist creation of reentrant library routines which use fts(3) internally. Not objected to in spirit by: -arch
* Fix a warning of "possibly used before initialisation".keramida2002-08-291-2/+1
| | | | Reviewed by: tjr
* Replace various spellings with FALLTHROUGH which is lint()ablecharnier2002-08-251-10/+10
|
* s/filesystem/file system/ as discussed on -developerstrhodes2002-08-211-1/+1
|
* mdoc(7) police: fixed the document date.ru2002-08-191-1/+1
| | | | Submitted by: iedowse
* Fix typos; each file has at least one s/seperat/separat/schweikh2002-08-111-1/+1
| | | | | | | | | | (I skipped those in contrib/, gnu/ and crypto/) While I was at it, fixed a lot more found by ispell that I could identify with certainty to be errors. All of these were in comments or text, not in actual code. Suggested by: bde MFC after: 3 days
* err() is documented as allowing NULL for the format string but GCC isn'tdillon2002-07-102-6/+6
| | | | happy about it any more so change the usage to make buildworld work again.
* Consistently use __FBSDIDobrien2002-06-304-16/+9
|
* Ignore empty COLUMNS environment variable. COLUMNS should take precedencetjr2002-06-041-5/+5
| | | | over TTY width found via ioctl() (SUSv3)
* mdoc(7) police: markup nits.ru2002-05-291-2/+3
|
* Add missing options required by SUSv3:tjr2002-05-195-16/+100
| | | | | | | | -m List files across the page, separated by commas. -p Print a slash after directory names -x Same as -C but sort across the columns rather than down Submitted by: Kyle Martin <mkm@ieee.org>
* Consistancy check s/file system/filesystem/trhodes2002-05-161-1/+1
| | | | Reviewed by: brian
* restore missing default case removed in ls.c:r1.57billf2002-05-152-0/+4
| | | | | | add break statements to default cases where missing. Submitted by: bde
* Make 'user' and 'group' const as to not discard the qualifier from thejmallett2002-05-151-1/+2
| | | | | functions we use to assign them. Doesn't seem to be anything else that relies on these being non-const.
* Remove an empty default case to make this syntactically correct. Not therejmallett2002-05-151-1/+0
| | | | is as good as blaknk.
OpenPOWER on IntegriCloud