History log of /freebsd-10.1-release/usr.bin/tr/tr.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


# 245767 22-Jan-2013 andrew

When copying the complement of the string loop to WINT_MAX as we are dealing
with a wint_t. WINT_MAX and WCHAR_MAX are the same on most architectures
except ARM EABI where wint_t is signed and wchar_t is unsigned.


# 227188 06-Nov-2011 ed

Add missing static keywords to tr(1)


# 216370 11-Dec-2010 joel

Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson


# 200462 13-Dec-2009 delphij

Revert most part of 200420 as requested, as more review and polish is
needed.


# 200420 11-Dec-2009 delphij

Remove unneeded header includes from usr.bin/ except contributed code.

Tested with: make universe


# 144840 09-Apr-2005 stefanf

Remove unused variables.


# 131855 09-Jul-2004 tjr

Report input errors instead of ignoring them.


# 131846 09-Jul-2004 tjr

Add support for multibyte characters. The challenge here was to use
data structures that scale better with large character sets, instead of
arrays indexed by character value:
- Sets of characters to delete/squeeze are stored in a new "cset" structure,
which is implemented as a splay tree of extents. This structure has the
ability to store character classes (ala wctype(3)), but this is not
currently fully utilized.
- Mappings between characters are stored in a new "cmap" structure, which
is also a splay tree.
- The parser no longer builds arrays containing all the characters in a
particular class; instead, next() determines them on-the-fly using
nextwctype(3).


# 118409 04-Aug-2003 ache

Special fix just for
tr -[cC]s '[:upper:]' '[:lower:]'
case (or vice versa):
chars taken from s2 can be different this time
due to lack of complex upper/lower processing,
so fill string2 again to not miss some.


# 118400 03-Aug-2003 ache

Microoptimization of prev. patch: do strdup() only if (cflag || Cflag)


# 118399 03-Aug-2003 ache

1) Fix -C - it was broken since introduced, wrong array sorted
2) Fix last (repeated) char after [:class:], it was \0 in original code


# 118373 03-Aug-2003 ache

Remove charcoll() stabilization added in 1.16, it gains nothing but conflicts
with ranges.


# 118371 03-Aug-2003 ache

This patch address two problems.

1st one is relatively minor: according our own manpage, upper and lower
classes must be sorted, but currently not.

2nd one is serious:
tr '[:lower:]' '[:upper:]'
(and vice versa) currently works only if upper and lower classes
have exact the same number of elements. When it is not true, like for
many ISO8859-x locales which have bigger amount of lowercase letters,
tr may do nasty things.

See this page
http://www.opengroup.org/onlinepubs/007908799/xcu/tr.html
for detailed description of desired tr behaviour in such cases.


# 102944 04-Sep-2002 dwmalone

ANSIify function definitions.
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.

Reviewed by: md5


# 100891 29-Jul-2002 tjr

When translating and -C is specified, behave as if the complemented set was
in the locale collating order as required by SUSv3.


# 100874 29-Jul-2002 tjr

When translating and the -c option is specified, handle the case where the
second string argument is more than one character in length in the way
required by SUSv3 (and the way GNU textutils and SVR4 do it).


# 98214 14-Jun-2002 tjr

Add the P1003.1-2001 -C option which complements the set of characters
(not byte values) specified by the first string argument.


# 98210 14-Jun-2002 tjr

Implement support for equivalence classes ([=e=]) when the mapping is
one-to-one (SUSv3)


# 92922 21-Mar-2002 imp

remove __P


# 91562 02-Mar-2002 alfred

properly handle zero length first string when doing -c

PR: 34663
MFC After: 3 days


# 87705 11-Dec-2001 markm

WARNS=2 fixes, use __FBSDID(), kill register keyword.


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 30322 12-Oct-1997 helbig

Submitted by: Joachim Kuebart, thanks.
Add -u option to force unbuffered output


# 28368 18-Aug-1997 charnier

Use err(3) instead of local redefinition. Cosmetic in usage().


# 24360 29-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# 23693 11-Mar-1997 peter

Merge from Lite2


# 11895 28-Oct-1995 ache

Fix broken charclass handling
Add setlocale LC_CTYPE


# 8874 30-May-1995 rgrimes

Remove trailing whitespace.


# 1591 27-May-1994 rgrimes

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


# 1590 27-May-1994 rgrimes

BSD 4.4 Lite Usr.bin Sources