History log of /freebsd-10.1-release/bin/ls/util.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 245091 06-Jan-2013 andrew

When WCHAR_MIN == 0 the check if a wchar_t value will always be true. In
this case skip the test as gcc complains it is always true.


# 242807 08-Nov-2012 grog

Replace spaces with tabs where appropriate.

Reminded by: jh@


# 242725 07-Nov-2012 grog

Add y flag and environment variable LS_SAMESORT to specify the same
sorting order for time and name with the -t option. IEEE Std 1003.2
(POSIX.2) mandates that the -t option sort in descending order, and
that if two files have the same timestamp, they should be sorted in
ascending order of their names. The -r flag reverses both of these
sort orders, so they're never the same. This creates significant
problems for sequentially named files stored on FAT file systems,
where it can be impossible to list them in the order in which they
were created.

Add , (comma) option to print file sizes grouped and separated by
thousands using the non-monetary separator returned by localeconv(3),
typically a comma or period.

MFC after: 14 days


# 177908 04-Apr-2008 ru

- Add -D to usage().
- Bump document date for the addition of the -D option.
- Reformat a sentence to look like a real sentence.


# 157098 24-Mar-2006 jhb

Add a new -U flag to instruct ls to use the birthtime for printing or
sorting.

Submitted by: Andrzej Tobola ato at iem dot pw dot edu dot pl
MFC after: 1 week


# 152469 16-Nov-2005 ru

Having three options (-a, -A, -I) controlling the output of dotted
files is too much and hard to follow. Instead, make the -I option
just mean "do not automatically set -A for root". That is, if -A
is explicitly set, -I is ignored. Also, document -I in usage().
(The ls.c diff is better viewed relative to rev. 1.80.)

No objection: mux
Silence from: mnag
MFC after: 3 days


# 146924 03-Jun-2005 dd

Add the -S option to sort files by size. NetBSD and OpenBSD already
have this option with identical semantics (sorting large files first).
-r can be used to reverse the sort if that is desired.

PR: 81625
Submitted by: Kostas Blekos <mplekos@physics.upatras.gr>, keramida


# 141578 09-Feb-2005 ru

Sync program's usage() with manpage's SYNOPSIS.


# 139969 10-Jan-2005 imp

/*- or .\"- or #- to begin license clauses.


# 128868 03-May-2004 tjr

Only add the widths together for printable characters in prn_normal();
unprintable characters have a "width" of -1.


# 128823 02-May-2004 tjr

Treat filenames as multibyte character strings (according to the current
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.


# 127958 06-Apr-2004 markm

Remove clause 3 from the UCB licenses.

OK'ed by: imp, core


# 119914 09-Sep-2003 tjr

Add the -m, -w and -x options to ls's usage message.

PR: 51493
Submitted by: Walter Belgers
MFC after: 1 month


# 114583 03-May-2003 markm

Fix a bazillion warnings. This makes almost the whole of src/bin/*
WARNS=6, std=c99 clean.

Tested on: i386, alpha


# 99109 30-Jun-2002 obrien

Consistently use __FBSDID


# 91498 28-Feb-2002 ache

Add (unsigned char) cast lost in WARNS=4 fixes which break 8bit locales

PR: 35421


# 90153 03-Feb-2002 markm

Use __FBSDID() and clean up the vendor tags.


# 90150 03-Feb-2002 markm

WARNS=4 fixes, plus a healthy dose of fixes inspired by lint.


# 90110 02-Feb-2002 imp

o __P has been reoved
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.


# 88591 28-Dec-2001 joe

Add a new flag, -h which when combined with the -l option causes
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


# 86922 26-Nov-2001 green

Add LOMAC options (the "Z" flag in both cases) to display extra information
in ls(1) and ps(1).

Sponsored by: DARPA, NAI Labs


# 63748 22-Jul-2000 green

Add the missing flags to ls(1)'s usage: -Bb.


# 62597 04-Jul-2000 assar

make sure we do not write out non-printable characters in file names
and symbolic links (by default)

PR: bin/19354
Reviewed by: silence on -current


# 61324 06-Jun-2000 ache

Add -G to usage: if COLORLS


# 50471 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 49373 02-Aug-1999 sheldonh

Add -n option to print numeric user and group IDs instead of names
in a long (-l) listing.

MFC-jockies should make sure that bde's concerns regarding the number
of digits required to represent a uid_t and the use of snprintf
on the associated PR have been addressed before going wild.

PR: 12866
Reported by: Philip Kizer <pckizer@nostrum.com>
Obtained from: NetBSD


# 40300 13-Oct-1998 des

Doh. What was I smoking when I wrote this?

PR: bin/8301
Submitted by: Tetsuya Furukawa <tetsuya@secom-sis.co.jp>


# 35441 24-Apr-1998 ache

Fix nasty error in len_octal, result not initialized


# 35440 24-Apr-1998 ache

Fix ctype error #1 - chars must be unsigned


# 35435 24-Apr-1998 des

Remove the bogus -? option after reading the getopt() manual :)


# 35426 24-Apr-1998 des

o Removed two unused variables (f_dirname and f_newline) in ls.c

o Added the -H and -P options for treatment of symbolic links.

o Removed the #ifdef BSD4_4_LITE, since it does not seem to do anything
useful

o Fixed up prn_octal() so its output looks more like that of AT&T Unices
when -b is given.

The next two lines apply only to the first two changes above:

PR: bin/6140
Submitted by: Max Euston


# 35417 24-Apr-1998 des

o Renamed '-b' (show unprintables in octal) to '-B'

o Added a new '-b' which behaves as in AT&T Unices (show unprintables in
octal, using C escape codes when possible)

o Added '?' to the getopt() string, since the code in the switch considers
it as a valid option.


# 35373 21-Apr-1998 des

Added -b option to display unprintables in octal.
PR: 1315


# 27967 07-Aug-1997 steve

Observe precedence set by Phillippe Charnier in adding an
rcsid.


# 27958 07-Aug-1997 steve

Remove #if(n)def BSD_4_4_LITE cruft and sccsid -> rcsid.


# 24301 26-Mar-1997 obrien

make usage() and SYNOPSIS agree with each other and add missing options
documented in the DESCRIPTION section.


# 22988 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 20417 14-Dec-1996 steve

Merge Lite2 mods, and -Wall cleaning. undelete(2) cruft
not yet implemented is protected by a define (BSD4_4_LITE)
that should be removed when this call is supported by the
kernel.


# 14952 31-Mar-1996 ache

Use unsigned char for isprint


# 3459 09-Oct-1994 ache

Back out ctype fix, unneded with new ctype


# 3044 24-Sep-1994 dg

Added $Id$


# 2955 21-Sep-1994 ache

Make ls ctype-aware


# 1557 26-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1556,
which included commits to RCS files with non-trunk default branches.


# 1556 26-May-1994 rgrimes

BSD 4.4 Lite bin Sources