summaryrefslogtreecommitdiffstats
path: root/bin/ls/print.c
Commit message (Collapse)AuthorAgeFilesLines
* /*- or .\"- or #- to begin license clauses.imp2005-01-101-1/+1
|
* 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.
* Use humanize_number(3).pjd2004-05-251-58/+5
| | | | Reminded by: jhb
* Treat filenames as multibyte character strings (according to the currenttjr2004-05-021-1/+2
| | | | | | | | | | | | | 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-061-4/+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>
* 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)
* Handle realloc() failure correctly.tjr2003-10-161-2/+5
|
* Fix a bazillion warnings. This makes almost the whole of src/bin/*markm2003-05-031-22/+21
| | | | | | WARNS=6, std=c99 clean. Tested on: i386, alpha
* 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
* Use warn() instead of perror() or fprintf() where appropriate.tjr2002-11-061-6/+4
|
* Print a `+' character after the standard UNIX permission fields in longtjr2002-11-031-0/+53
| | | | | | | | 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)
* Teach "ls -Z" to use the policy-agnostic MAC label interfaces ratherrwatson2002-10-241-2/+2
| | | | | | | | | | | 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
|
* Print non-printing characters in directory names, as well as file names,tjr2002-10-181-1/+1
| | | | | | | 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
* Fix a warning of "possibly used before initialisation".keramida2002-08-291-2/+1
| | | | Reviewed by: tjr
* Consistently use __FBSDIDobrien2002-06-301-4/+2
|
* Add missing options required by SUSv3:tjr2002-05-191-2/+47
| | | | | | | | -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>
* restore missing default case removed in ls.c:r1.57billf2002-05-151-0/+1
| | | | | | add break statements to default cases where missing. Submitted by: bde
* #include <time.h> for the definition of time functions instead ofbde2002-02-251-2/+1
| | | | | | depending on namespace pollution 2 layers deep in <sys/stat.h>. Removed unused includes.
* Use __FBSDID() and clean up the vendor tags.markm2002-02-031-5/+6
|
* WARNS=4 fixes, plus a healthy dose of fixes inspired by lint.markm2002-02-031-13/+12
|
* o __P has been reovedimp2002-02-021-45/+25
| | | | | | | | | o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are.
* LSCOLOURS should be spelt LSCOLORS.joe2001-12-291-1/+1
| | | | Submitted by: Jordan DeLong <fracture@allusion.net
* Restore these files to shiny KNF.joe2001-12-291-43/+43
|
* Convert some spaces into tabs that I missed first time around.joe2001-12-281-30/+30
|
* Revert most of rev 1.42, to restore KNF style.joe2001-12-281-49/+49
| | | | Requested by: bde
* Add a new flag, -h which when combined with the -l option causesjoe2001-12-281-1/+71
| | | | | | | | file sizes to be displayed with unit suffixes; Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to three or less. Submitted by: nik
* Make it clearer what changed to a user using the old format of LSCOLORS.joe2001-12-281-3/+3
|
* Mop up some warnings.joe2001-12-281-2/+2
|
* Make the style more consistent throughout the file.joe2001-12-281-58/+71
|
* Use the default colour instead if a bad colour specification is given.joe2001-12-281-1/+1
|
* Revamp the colour support to allow for bold characters. Coloursjoe2001-12-281-15/+39
| | | | | | | | are now defined using the characters a-h and A-H for the bold variants. The old way using 0-7 for the colours still works, but prints a message asking the user to switch. PR: bin/27374
* Add LOMAC options (the "Z" flag in both cases) to display extra informationgreen2001-11-261-0/+2
| | | | | | in ls(1) and ps(1). Sponsored by: DARPA, NAI Labs
* Silence minor cc warningache2001-03-211-1/+1
|
* Use nl_langinfo instead of %Efache2001-03-211-6/+7
|
* make sure we do not write out non-printable characters in file namesassar2000-07-041-9/+19
| | | | | | | and symbolic links (by default) PR: bin/19354 Reviewed by: silence on -current
* I broke locale sensitive ordering of date and month injoe2000-06-211-6/+9
| | | | | | | | | | the long -l output format with the last commit. Fix it by replacing the "%b %e" strftime format with "%Ef". Make a note in the manual page that the LANG environment variable affects the running of ls. Reviewed by: ache
* Don't assume that the output of strftime for "%c" ("nationaljoe2000-06-181-15/+10
| | | | | | | | | representation of time and date") won't change in time. Instead of hard coding the locations of the time elements and hoping that they don't move use strftime to generate the desired formats in the first place. PR: bin/7826
* Greately simplify oxtabs fix by simple setting f_notabs for f_colorache2000-06-061-13/+0
|
* Honor f_notabs flag even in COLORLSache2000-06-061-1/+1
|
* Back out spaces to TABs replace removing for COLORLSache2000-06-061-0/+13
| | | | | Rewrite corresponding comment to say what happens in reality with oxtabs and current terminal column.
* Don't replace TABs with spaces for COLORLS because "some terminals get confused"ache2000-06-061-12/+0
| | | | | as comment says. I know no terminal confused by this. If even such terminal exists, it must be termcap flag for this, not hardcoded in ls.
* Staticize more functionsache2000-06-061-4/+7
|
* Make signal handler safe - don't use stdio (pointed by bde)ache2000-06-061-12/+26
| | | | | | Staticize some color functions Add yet one tolower() call which is forgotten after check Don't check for OOPS - not really needed
* Get rid of curses completely - use tgoto instead of tparmache2000-06-051-5/+4
|
* Kill yourself in ^C handler, not exit(1) to allow script to sense signalache2000-06-051-7/+10
|
* Cosmetique of prev. optimization - don't use global variableache2000-06-051-1/+6
|
OpenPOWER on IntegriCloud