/[base]/head/usr.bin/tr/tr.c
ViewVC logotype

Log of /head/usr.bin/tr/tr.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (annotate)
Sticky Revision:

Revision 335395 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jun 19 23:43:14 2018 UTC (6 years ago) by oshogbo
File length: 9375 byte(s)
Diff to previous 326025
Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.

No functional change intended.


Revision 326025 - (view) (download) (annotate) - [select for diffs]
Modified Mon Nov 20 19:49:47 2017 UTC (6 years, 7 months ago) by pfg
File length: 9393 byte(s)
Diff to previous 314436
General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


Revision 314436 - (view) (download) (annotate) - [select for diffs]
Modified Tue Feb 28 23:42:47 2017 UTC (7 years, 4 months ago) by imp
File length: 9348 byte(s)
Diff to previous 306813
Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96


Revision 306813 - (view) (download) (annotate) - [select for diffs]
Modified Fri Oct 7 17:56:57 2016 UTC (7 years, 8 months ago) by oshogbo
File length: 9348 byte(s)
Diff to previous 305998
Remove the duplicated code using Capsicum helpers.

Reviewed by:	cem, ed, bapt, emaste
Differential Revision	https://reviews.freebsd.org/D8140


Revision 305998 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 19 20:43:03 2016 UTC (7 years, 9 months ago) by cem
File length: 10200 byte(s)
Diff to previous 305982
Move sys/capsicum.h includes after types.h or param.h

This is not actually documented or even implied in style(9).  Make the change
to match convention.  Someone should document this convention in style(9).

Reported by:	jhb
Sponsored by:	EMC Dell Isilon


Revision 305982 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 19 16:14:38 2016 UTC (7 years, 9 months ago) by cem
File length: 10200 byte(s)
Diff to previous 302827
tr(1): Capsicumify

This is a straightforward single input, single output program for
capsicum.

Reviewed by:	bapt
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D7928


Revision 302827 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jul 14 09:26:53 2016 UTC (7 years, 11 months ago) by ache
File length: 9138 byte(s)
Diff to previous 302825
Optimize [Cc]flag case: don't repeatedly add the last character of
string2 to squeeze cset when string2 reach its EOS state.


Revision 302825 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jul 14 09:19:53 2016 UTC (7 years, 11 months ago) by ache
File length: 9128 byte(s)
Diff to previous 302711
Back out non-collating [a-z] ranges (r302594).
Instead of changing the whole course to another POSIX-permitted way
for consistency and uniformity I decide to completely ignore missing
regex fucntionality and focus on fixing bugs in what we have now,
too many small obstacles we have choicing other way, counting ports.
Corresponding libc changes are backed out in r302824.


Revision 302711 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jul 13 07:56:01 2016 UTC (7 years, 11 months ago) by ache
File length: 8280 byte(s)
Diff to previous 302616
Fully back out r302594 case 2) since overflow may happens.


Revision 302616 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jul 12 04:29:34 2016 UTC (7 years, 11 months ago) by ache
File length: 8281 byte(s)
Diff to previous 302599
Undo r302599 and partially r302594 case 2):
since WCHAR_MAX can be not a valid wchar value, it is easier to stay
inside wint_t.


Revision 302599 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 11 23:06:11 2016 UTC (7 years, 11 months ago) by ache
File length: 8290 byte(s)
Diff to previous 302594
Cast WCHAR_MAX to wint_t, it can be unsigned on some systems.


Revision 302594 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 11 21:23:50 2016 UTC (7 years, 11 months ago) by ache
File length: 8282 byte(s)
Diff to previous 245767
1) Following r302512 (remove collation support for [a-z]-ranges in libc)
remove collation support for a-z ranges here too.
It was implemented for single byte locales only in any case.

2) Reduce [Cc]flag loop to WCHAR_MAX, WINT_MAX here includes WEOF which is
not a character.

3) Optimize [Cc]flag case: don't repeatedly add the last character of
string2 to squeeze cset when string2 reach its EOS state.

4) Reflect in the manpage that [=equiv=] is implemented for single
byte locales only.


Revision 245767 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 22 05:39:34 2013 UTC (11 years, 5 months ago) by andrew
File length: 9128 byte(s)
Diff to previous 227188
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.


Revision 227188 - (view) (download) (annotate) - [select for diffs]
Modified Sun Nov 6 08:17:42 2011 UTC (12 years, 7 months ago) by ed
File length: 9109 byte(s)
Diff to previous 216370
Add missing static keywords to tr(1)


Revision 216370 - (view) (download) (annotate) - [select for diffs]
Modified Sat Dec 11 08:32:16 2010 UTC (13 years, 6 months ago) by joel
File length: 9095 byte(s)
Diff to previous 200462
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


Revision 200462 - (view) (download) (annotate) - [select for diffs]
Modified Sun Dec 13 03:14:06 2009 UTC (14 years, 6 months ago) by delphij
File length: 9332 byte(s)
Diff to previous 200420
Revert most part of 200420 as requested, as more review and polish is
needed.


Revision 200420 - (view) (download) (annotate) - [select for diffs]
Modified Fri Dec 11 23:35:38 2009 UTC (14 years, 6 months ago) by delphij
File length: 9254 byte(s)
Diff to previous 144840
Remove unneeded header includes from usr.bin/ except contributed code.

Tested with:	make universe


Revision 144840 - (view) (download) (annotate) - [select for diffs]
Modified Sat Apr 9 14:31:41 2005 UTC (19 years, 2 months ago) by stefanf
File length: 9332 byte(s)
Diff to previous 131855
Remove unused variables.


Revision 131855 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 9 05:15:46 2004 UTC (19 years, 11 months ago) by tjr
File length: 9335 byte(s)
Diff to previous 131846
Report input errors instead of ignoring them.


Revision 131846 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 9 02:08:07 2004 UTC (19 years, 11 months ago) by tjr
File length: 9185 byte(s)
Diff to previous 118409
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).


Revision 118409 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 4 02:57:17 2003 UTC (20 years, 11 months ago) by ache
File length: 9474 byte(s)
Diff to previous 118400
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.


Revision 118400 - (view) (download) (annotate) - [select for diffs]
Modified Sun Aug 3 22:19:43 2003 UTC (20 years, 11 months ago) by ache
File length: 9267 byte(s)
Diff to previous 118399
Microoptimization of prev. patch: do strdup() only if (cflag || Cflag)


Revision 118399 - (view) (download) (annotate) - [select for diffs]
Modified Sun Aug 3 22:02:49 2003 UTC (20 years, 11 months ago) by ache
File length: 9235 byte(s)
Diff to previous 118373
1) Fix -C - it was broken since introduced, wrong array sorted
2) Fix last (repeated) char after [:class:], it was \0 in original code


Revision 118373 - (view) (download) (annotate) - [select for diffs]
Modified Sun Aug 3 04:18:07 2003 UTC (20 years, 11 months ago) by ache
File length: 9434 byte(s)
Diff to previous 118371
Remove charcoll() stabilization added in 1.16, it gains nothing but conflicts
with ranges.


Revision 118371 - (view) (download) (annotate) - [select for diffs]
Modified Sun Aug 3 02:23:39 2003 UTC (20 years, 11 months ago) by ache
File length: 9504 byte(s)
Diff to previous 102944
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.


Revision 102944 - (view) (download) (annotate) - [select for diffs]
Modified Wed Sep 4 23:29:10 2002 UTC (21 years, 10 months ago) by dwmalone
File length: 8578 byte(s)
Diff to previous 100891
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


Revision 100891 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 29 23:42:00 2002 UTC (21 years, 11 months ago) by tjr
File length: 8625 byte(s)
Diff to previous 100874
When translating and -C is specified, behave as if the complemented set was
in the locale collating order as required by SUSv3.


Revision 100874 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 29 14:50:54 2002 UTC (21 years, 11 months ago) by tjr
File length: 7937 byte(s)
Diff to previous 98214
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).


Revision 98214 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jun 14 08:58:30 2002 UTC (22 years ago) by tjr
File length: 7913 byte(s)
Diff to previous 98210
Add the P1003.1-2001 -C option which complements the set of characters
(not byte values) specified by the first string argument.


Revision 98210 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jun 14 07:37:08 2002 UTC (22 years ago) by tjr
File length: 7355 byte(s)
Diff to previous 92922
Implement support for equivalence classes ([=e=]) when the mapping is
one-to-one (SUSv3)


Revision 92922 - (view) (download) (annotate) - [select for diffs]
Modified Fri Mar 22 01:42:45 2002 UTC (22 years, 3 months ago) by imp
File length: 7358 byte(s)
Diff to previous 91562
remove __P


Revision 91562 - (view) (download) (annotate) - [select for diffs]
Modified Sat Mar 2 10:36:37 2002 UTC (22 years, 4 months ago) by alfred
File length: 7370 byte(s)
Diff to previous 87705
properly handle zero length first string when doing -c

PR: 34663
MFC After: 3 days


Revision 87705 - (view) (download) (annotate) - [select for diffs]
Modified Tue Dec 11 23:36:25 2001 UTC (22 years, 6 months ago) by markm
File length: 7353 byte(s)
Diff to previous 50477
WARNS=2 fixes, use __FBSDID(), kill register keyword.


Revision 50477 - (view) (download) (annotate) - [select for diffs]
Modified Sat Aug 28 01:08:13 1999 UTC (24 years, 10 months ago) by peter
File length: 7403 byte(s)
Diff to previous 30322
$Id$ -> $FreeBSD$


Revision 30322 - (view) (download) (annotate) - [select for diffs]
Modified Sun Oct 12 09:52:49 1997 UTC (26 years, 8 months ago) by helbig
File length: 7443 byte(s)
Diff to previous 28368
Submitted by:	Joachim Kuebart, thanks.
Add -u option to force unbuffered output


Revision 28368 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 18 07:24:58 1997 UTC (26 years, 10 months ago) by charnier
File length: 7337 byte(s)
Diff to previous 24360
Use err(3) instead of local redefinition. Cosmetic in usage().


Revision 24360 - (view) (download) (annotate) - [select for diffs]
Modified Sat Mar 29 04:34:07 1997 UTC (27 years, 3 months ago) by imp
File length: 7699 byte(s)
Diff to previous 23693
compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


Revision 23693 - (view) (download) (annotate) - [select for diffs]
Modified Tue Mar 11 13:43:33 1997 UTC (27 years, 3 months ago) by peter
File length: 7700 byte(s)
Diff to previous 11895
Merge from Lite2


Revision 11895 - (view) (download) (annotate) - [select for diffs]
Modified Sat Oct 28 22:27:03 1995 UTC (28 years, 8 months ago) by ache
File length: 7678 byte(s)
Diff to previous 8874
Fix broken charclass handling
Add setlocale LC_CTYPE


Revision 8874 - (view) (download) (annotate) - [select for diffs]
Modified Tue May 30 06:41:30 1995 UTC (29 years, 1 month ago) by rgrimes
File length: 7624 byte(s)
Diff to previous 1591
Remove trailing whitespace.


Revision 1591 - (view) (download) (annotate) - [select for diffs]
Modified Fri May 27 12:33:43 1994 UTC (30 years, 1 month ago) by rgrimes
File length: 7626 byte(s)
Copied from: vendor/CSRG/dist/usr.bin/tr/tr.c revision 1590
Diff to previous 1590
This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.


Revision 1590 - (view) (download) (annotate) - [select for diffs]
Added Fri May 27 12:33:43 1994 UTC (30 years, 1 month ago) by rgrimes
Original Path: vendor/CSRG/dist/usr.bin/tr/tr.c
File length: 7626 byte(s)
BSD 4.4 Lite Usr.bin Sources


This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

  ViewVC Help
Powered by ViewVC 1.1.27