summaryrefslogtreecommitdiffstats
path: root/usr.bin/tr
Commit message (Collapse)AuthorAgeFilesLines
* When copying the complement of the string loop to WINT_MAX as we are dealingandrew2013-01-221-1/+2
| | | | | 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.
* mdoc: terminate quoted strings.joel2012-03-261-23/+23
| | | | Reviewed by: brueffer
* Remove superfluous paragraph macro.joel2012-03-251-2/+0
|
* Replace index() and rindex() calls with strchr() and strrchr().ed2012-01-031-1/+1
| | | | | | | | | | The index() and rindex() functions were marked LEGACY in the 2001 revision of POSIX and were subsequently removed from the 2008 revision. The strchr() and strrchr() functions are part of the C standard. This makes the source code a lot more consistent, as most of these C files also call into other str*() routines. In fact, about a dozen already perform strchr() calls.
* Add missing static keywords to tr(1)ed2011-11-061-2/+2
|
* Put parentheses in the right place.ed2011-10-141-2/+2
| | | | | Noted by: jilles@ Broken by: me. :-(
* Build tr(1) with WARNS=6.ed2011-10-143-14/+7
|
* Remove the advertising clause from UCB copyrighted files in usr.bin. Thisjoel2010-12-114-16/+0
| | | | | | | | | 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
* tr: Fix '[=]=]' equivalence class.jilles2010-09-291-1/+1
| | | | | | | | | | | A closing bracket immediately after '[=' should not be treated as special. Different from the submitted patch, a string ending with '[=' does not cause access beyond the terminating '\0'. PR: bin/150384 Submitted by: Richard Lowe MFC after: 2 weeks
* Build usr.bin/ with WARNS=6 by default.ed2010-01-021-0/+2
| | | | Also add some missing $FreeBSD$ to keep svn happy.
* Revert most part of 200420 as requested, as more review and polish isdelphij2009-12-136-0/+14
| | | | needed.
* Remove unneeded header includes from usr.bin/ except contributed code.delphij2009-12-116-14/+0
| | | | Tested with: make universe
* o Remove duplicate includes.maxim2007-01-201-1/+0
| | | | Obtained from: Slava Semushin via NetBSD
* - Document all character classes our tr(1) supports. [1]ru2006-10-131-2/+14
| | | | | | | | | - Mention that some of them are POSIX extensions. [2] PR: docs/85062 [1] Submitted by: Toby Peterson [1] Obtained from: wctype(3) [2] MFC after: 3 days
* Remove unused variables.stefanf2005-04-091-1/+1
|
* Expand contractions.ru2005-02-131-1/+1
|
* Sort sections.ru2005-01-181-2/+2
|
* Added the EXIT STATUS section where appropriate.ru2005-01-171-1/+1
|
* Formatting fixes.ru2005-01-111-9/+11
| | | | (This exposes a bug in mdoc(7) for which a patch has been sent upstream.)
* tr(1) attempts to convert \n[n][n] sequences into octal digits, but doesn'tjkh2004-11-141-1/+1
| | | | | | | | check to see that a given digit is actually an octal digit. This leads to unusual consequences if passed in values like \9. Reported by: Joseph Davison (OpenDarwin project) MFC after: 1 week
* Tweak markup of quoted strings and characters: use Dq instead of enclosingtjr2004-07-231-12/+44
| | | | strings in ``obsolete quotes''. Use Li and Ql where appropriate.
* Add a lengthy discussion of why "tr a-z A-Z" and "tr A-Z a-z" are not thetjr2004-07-231-1/+41
| | | | right way to perform case-conversion.
* Fix description of cmap_lookup_hard().tjr2004-07-141-1/+1
|
* Remove unused member of struct csclass: csc_value.tjr2004-07-141-1/+0
|
* Splay the left and right subtrees on min - 1 and max + 1, respectively,tjr2004-07-141-34/+20
| | | | | before trying to coalesce. Forgetting to splay caused us to miss many opportunities for coalescing.
* Initialize cs_invert to "false" in new csets.tjr2004-07-101-0/+1
|
* Report input errors instead of ignoring them.tjr2004-07-091-0/+8
|
* Update for multibyte character support: remove BUGS and change thetjr2004-07-091-7/+2
| | | | description of the -c option to refer to "values" instead of "byte values".
* Add support for multibyte characters. The challenge here was to usetjr2004-07-098-200/+880
| | | | | | | | | | | | | | 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).
* Mechanically kill hard sentence breaks.ru2004-07-021-1/+1
|
* Document incorrect handling of multibyte characters in input filestjr2004-06-281-1/+6
| | | | and character string arguments.
* Back out [:upper:] and [:lower:] classes sorting, it is not requiredache2003-08-051-6/+3
| | | | by POSIX and gains nothing with current code.
* Clarify upper/lower conversion description more.ache2003-08-051-7/+4
|
* Explain better what happens when [:lower:] <-> [:upper:]ache2003-08-051-0/+19
|
* No functional changes, just code reorganization from prev. commit, itache2003-08-042-12/+18
| | | | | | makes one malloc unneeded, removes two bzero's and makes code more readable. "Bright ideas comes only _after_ commits."
* POSIX require complex processing of 'c-c' ranges: if one of the endpointsache2003-08-042-22/+41
| | | | | | | is octal sequence, range is taken in the byte values order, for non-octal endpoints range is taken in the sorted collation order. Implement it.
* Special fix just forache2003-08-041-0/+7
| | | | | | | | 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.
* Microoptimization of prev. patch: do strdup() only if (cflag || Cflag)ache2003-08-031-3/+5
|
* 1) Fix -C - it was broken since introduced, wrong array sortedache2003-08-032-23/+19
| | | | 2) Fix last (repeated) char after [:class:], it was \0 in original code
* Remove charcoll() stabilization added in 1.16, it gains nothing but conflictsache2003-08-031-5/+1
| | | | with ranges.
* POSIX requires 'c-c' must conform collate and be in collation orderache2003-08-033-15/+23
|
* This patch address two problems.ache2003-08-033-20/+70
| | | | | | | | | | | | | | | | 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.
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/schweikh2002-12-301-1/+1
| | | | Add FreeBSD Id tag where missing.
* mdoc(7) police: markup polishing.ru2002-11-261-7/+5
| | | | Approved by: re
* Use .Fl/Ar for flags and arguments.charnier2002-10-171-4/+6
|
* ANSIify function definitions.dwmalone2002-09-041-10/+3
| | | | | | | | | 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
* When translating and -C is specified, behave as if the complemented set wastjr2002-07-291-0/+26
| | | | in the locale collating order as required by SUSv3.
* When translating and the -c option is specified, handle the case where thetjr2002-07-291-6/+11
| | | | | 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).
* Use err instead of errx when malloc fails. "malloc" is not a helpfultjr2002-07-051-1/+1
| | | | error message.
* Improve parsing of character and equivalence classes:tjr2002-06-151-4/+9
| | | | | [:*] and [=*] are parsed as `infinitely many repetitions of :' (or *) instead of literal characters (SUSv3)
OpenPOWER on IntegriCloud