aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/tr
Commit message (Collapse)AuthorAgeFilesLines
* o Remove duplicate includes.Maxim Konovalov2007-01-201-1/+0
| | | | | | | Obtained from: Slava Semushin via NetBSD Notes: svn path=/head/; revision=166134
* - Document all character classes our tr(1) supports. [1]Ruslan Ermilov2006-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 Notes: svn path=/head/; revision=163315
* Remove unused variables.Stefan Farfeleder2005-04-091-1/+1
| | | | Notes: svn path=/head/; revision=144840
* Expand contractions.Ruslan Ermilov2005-02-131-1/+1
| | | | Notes: svn path=/head/; revision=141851
* Sort sections.Ruslan Ermilov2005-01-181-2/+2
| | | | Notes: svn path=/head/; revision=140420
* Added the EXIT STATUS section where appropriate.Ruslan Ermilov2005-01-171-1/+1
| | | | Notes: svn path=/head/; revision=140368
* Formatting fixes.Ruslan Ermilov2005-01-111-9/+11
| | | | | | | (This exposes a bug in mdoc(7) for which a patch has been sent upstream.) Notes: svn path=/head/; revision=140054
* tr(1) attempts to convert \n[n][n] sequences into octal digits, but doesn'tJordan K. Hubbard2004-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 Notes: svn path=/head/; revision=137685
* Tweak markup of quoted strings and characters: use Dq instead of enclosingTim J. Robbins2004-07-231-12/+44
| | | | | | | strings in ``obsolete quotes''. Use Li and Ql where appropriate. Notes: svn path=/head/; revision=132574
* Add a lengthy discussion of why "tr a-z A-Z" and "tr A-Z a-z" are not theTim J. Robbins2004-07-231-1/+41
| | | | | | | right way to perform case-conversion. Notes: svn path=/head/; revision=132572
* Fix description of cmap_lookup_hard().Tim J. Robbins2004-07-141-1/+1
| | | | Notes: svn path=/head/; revision=132144
* Remove unused member of struct csclass: csc_value.Tim J. Robbins2004-07-141-1/+0
| | | | Notes: svn path=/head/; revision=132143
* Splay the left and right subtrees on min - 1 and max + 1, respectively,Tim J. Robbins2004-07-141-34/+20
| | | | | | | | before trying to coalesce. Forgetting to splay caused us to miss many opportunities for coalescing. Notes: svn path=/head/; revision=132142
* Initialize cs_invert to "false" in new csets.Tim J. Robbins2004-07-101-0/+1
| | | | Notes: svn path=/head/; revision=131891
* Report input errors instead of ignoring them.Tim J. Robbins2004-07-091-0/+8
| | | | Notes: svn path=/head/; revision=131855
* Update for multibyte character support: remove BUGS and change theTim J. Robbins2004-07-091-7/+2
| | | | | | | description of the -c option to refer to "values" instead of "byte values". Notes: svn path=/head/; revision=131849
* Add support for multibyte characters. The challenge here was to useTim J. Robbins2004-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). Notes: svn path=/head/; revision=131846
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-021-1/+1
| | | | Notes: svn path=/head/; revision=131491
* Document incorrect handling of multibyte characters in input filesTim J. Robbins2004-06-281-1/+6
| | | | | | | and character string arguments. Notes: svn path=/head/; revision=131228
* Back out [:upper:] and [:lower:] classes sorting, it is not requiredAndrey A. Chernov2003-08-051-6/+3
| | | | | | | by POSIX and gains nothing with current code. Notes: svn path=/head/; revision=118475
* Clarify upper/lower conversion description more.Andrey A. Chernov2003-08-051-7/+4
| | | | Notes: svn path=/head/; revision=118474
* Explain better what happens when [:lower:] <-> [:upper:]Andrey A. Chernov2003-08-051-0/+19
| | | | Notes: svn path=/head/; revision=118460
* No functional changes, just code reorganization from prev. commit, itAndrey A. Chernov2003-08-042-12/+18
| | | | | | | | | makes one malloc unneeded, removes two bzero's and makes code more readable. "Bright ideas comes only _after_ commits." Notes: svn path=/head/; revision=118415
* POSIX require complex processing of 'c-c' ranges: if one of the endpointsAndrey A. Chernov2003-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. Notes: svn path=/head/; revision=118412
* Special fix just forAndrey A. Chernov2003-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. Notes: svn path=/head/; revision=118409
* Microoptimization of prev. patch: do strdup() only if (cflag || Cflag)Andrey A. Chernov2003-08-031-3/+5
| | | | Notes: svn path=/head/; revision=118400
* 1) Fix -C - it was broken since introduced, wrong array sortedAndrey A. Chernov2003-08-032-23/+19
| | | | | | | 2) Fix last (repeated) char after [:class:], it was \0 in original code Notes: svn path=/head/; revision=118399
* Remove charcoll() stabilization added in 1.16, it gains nothing but conflictsAndrey A. Chernov2003-08-031-5/+1
| | | | | | | with ranges. Notes: svn path=/head/; revision=118373
* POSIX requires 'c-c' must conform collate and be in collation orderAndrey A. Chernov2003-08-033-15/+23
| | | | Notes: svn path=/head/; revision=118372
* This patch address two problems.Andrey A. Chernov2003-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. Notes: svn path=/head/; revision=118371
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/Jens Schweikhardt2002-12-301-1/+1
| | | | | | | Add FreeBSD Id tag where missing. Notes: svn path=/head/; revision=108470
* mdoc(7) police: markup polishing.Ruslan Ermilov2002-11-261-7/+5
| | | | | | | Approved by: re Notes: svn path=/head/; revision=107276
* Use .Fl/Ar for flags and arguments.Philippe Charnier2002-10-171-4/+6
| | | | Notes: svn path=/head/; revision=105323
* ANSIify function definitions.David Malone2002-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 Notes: svn path=/head/; revision=102944
* When translating and -C is specified, behave as if the complemented set wasTim J. Robbins2002-07-291-0/+26
| | | | | | | in the locale collating order as required by SUSv3. Notes: svn path=/head/; revision=100891
* When translating and the -c option is specified, handle the case where theTim J. Robbins2002-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). Notes: svn path=/head/; revision=100874
* Use err instead of errx when malloc fails. "malloc" is not a helpfulTim J. Robbins2002-07-051-1/+1
| | | | | | | error message. Notes: svn path=/head/; revision=99433
* Improve parsing of character and equivalence classes:Tim J. Robbins2002-06-151-4/+9
| | | | | | | | [:*] and [=*] are parsed as `infinitely many repetitions of :' (or *) instead of literal characters (SUSv3) Notes: svn path=/head/; revision=98242
* Move the #include and #define's to the top of the file.Tim J. Robbins2002-06-141-4/+4
| | | | Notes: svn path=/head/; revision=98222
* Bump the size of the equivalence set to NCHARS; this file was left outTim J. Robbins2002-06-141-1/+1
| | | | | | | of a previous commit implementing equivalence classes. Notes: svn path=/head/; revision=98221
* Sort sections. Avoid using "The -? option" at the start of option descriptions.Tim J. Robbins2002-06-141-11/+7
| | | | Notes: svn path=/head/; revision=98217
* Don't treat the trailing ']' of an equivalence class expression as aTim J. Robbins2002-06-141-1/+2
| | | | | | | | character in the set. tr -d '[=a=]' was deleting ]'s as well as a's. Noticed by the textutils test suite. Notes: svn path=/head/; revision=98215
* Add the P1003.1-2001 -C option which complements the set of charactersTim J. Robbins2002-06-142-29/+58
| | | | | | | (not byte values) specified by the first string argument. Notes: svn path=/head/; revision=98214
* Implement support for equivalence classes ([=e=]) when the mapping isTim J. Robbins2002-06-143-14/+45
| | | | | | | one-to-one (SUSv3) Notes: svn path=/head/; revision=98210
* remove __PWarner Losh2002-03-223-12/+13
| | | | Notes: svn path=/head/; revision=92922
* properly handle zero length first string when doing -cAlfred Perlstein2002-03-021-0/+1
| | | | | | | | PR: 34663 MFC After: 3 days Notes: svn path=/head/; revision=91562
* WARNS=2 fixes, use __FBSDID(), kill register keyword.Mark Murray2001-12-112-35/+37
| | | | Notes: svn path=/head/; revision=87705
* mdoc(7) police: utilize the new .Ex macro.Ruslan Ermilov2001-08-151-3/+1
| | | | Notes: svn path=/head/; revision=81687
* mdoc(7) police: s/BSD/.Bx/ where appropriate.Ruslan Ermilov2001-08-141-1/+3
| | | | Notes: svn path=/head/; revision=81622
* Remove whitespace at EOL.Dima Dorfman2001-07-151-2/+2
| | | | Notes: svn path=/head/; revision=79755