summaryrefslogtreecommitdiffstats
path: root/lib/libc/locale
Commit message (Collapse)AuthorAgeFilesLines
* MFC r291296:ngie2015-12-051-0/+1
| | | | Link localeconv(3) to localeconv_l(3)
* MFC: r286490,r286491,r287125bapt2015-09-021-16/+6
| | | | | | | | | Per rfc3629 value greater than 0x10ffff should be rejected (r286490,r286491) Make UTF-8 parsing and generation more strict. (r287125 by ed) - in mbrtowc() we need to disallow codepoints above 0x10ffff. - In wcrtomb() we need to disallow codepoints between 0xd800 and 0xdfff.
* MFC r264038 (theraven):delphij2015-06-172-9/+9
| | | | | | | | Fix an issue where the locale and rune locale could become out of sync, causing mb* functions (and similar) to be called with the wrong data (possibly a null pointer, causing a crash). PR: standards/188036
* MFC r275805:tijl2015-04-302-4/+2
| | | | | | | | | | | | | Fix incorrect type of "invalids" argument in __iconv() prototype. MFC r281550,281591: Remove the const qualifier from iconv(3) to comply with POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html Adjust all code that calls iconv. PR: 199099
* MFC r268272:pfg2014-07-121-19/+10
| | | | | | | | | | | minor perf enhancement for UTF-8 Reduce some duplicate code. Reference: https://www.illumos.org/issues/628 Obtained from: Illumos
* MFC r265095, r265167;pfg2014-05-051-0/+7
| | | | | | | | | | | | | | | | | | citrus: Avoid invalid code points. The UTF-8 decoder should not accept byte sequences which decode to unicode code positions U+D800 to U+DFFF (UTF-16 surrogates).[1] Contrary to the original OpenBSD patch, we do pass U+FFFE and U+FFFF, both values are valid "non-characters" [2] and must be mapped through UTFs. [1] http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 [2] http://www.unicode.org/faq/private_use.html Reported by: Stefan Sperling [1] Thanks to: jilles [2] Obtained from: OpenBSD
* Replace the #define for "iconv" so it is for the function name instead ofpeter2013-07-032-2/+4
| | | | | | a macro with parameters. Remove a __DECONST hack and add consts instead for gnu libiconv API compatability. This makes it work with things like devel/boost-libs that expects to use "iconv" as though it were a pointer.
* Add libiconv based versions of *c16*() and *c32*().ed2013-06-037-3/+314
| | | | | | | | | | | | | I initially thought wchar_t was locale independent, but this seems to be only the case on Linux. This means that we cannot depend on the *wc*() routines to implement *c16*() and *c32*(). Instead, use the Citrus libiconv that is part of libc. I'll see if there is anything I can do to make the existing functions somewhat useful in case the system is built without libiconv in the nearby future. If not, I'll simply remove the broken implementations. Reviewed by: jilles, gabor
* Add <uchar.h>.ed2013-05-219-52/+410
| | | | | | | | | | | | The <uchar.h> header, part of C11, adds a small number of utility functions for 16/32-bit "universal" characters, which may or may not be UTF-16/32. As our wchar_t is already ISO 10646, simply add light-weight wrappers around wcrtomb() and mbrtowc(). While there, also add (non-yet-standard) _l functions, similar to the ones we already have for the other locale-dependent functions. Reviewed by: theraven
* Document that the return type is different from 1003.1-2008.pluknet2013-05-041-2/+9
| | | | MFC after: 1 week
* mdoc: missing comma in .Dd macro.pluknet2013-05-045-5/+5
|
* Also, add a missing period.pluknet2013-05-033-3/+3
|
* Remove an extra comma.pluknet2013-05-033-3/+3
|
* Remove the STANDARDS section.pluknet2013-05-031-4/+1
| | | | | | querylocale is not part of IEEE Std 1003.1-2008. MFC after: 3 days
* btowc(3), isblank(3): Correct prototypes for _l variants.jilles2013-03-272-3/+3
| | | | MFC after: 1 week
* libc: Make various internal file descriptors close-on-exec.jilles2012-12-112-2/+2
| | | | These are obtained via fopen().
* Improve style(9) compliance of function declarations.brooks2012-12-101-4/+12
|
* libc: Use O_CLOEXEC for various internal file descriptors.jilles2012-09-291-1/+1
| | | | | | | | | This fixes a race condition where another thread may fork() before CLOEXEC is set, unintentionally passing the descriptor to the child process. This commit only adds O_CLOEXEC flags to open() or openat() calls where no fcntl(fd, F_SETFD, FD_CLOEXEC) follows. The separate fcntl() call still leaves a race window so it should be fixed later.
* Remove trailing whitespace.joel2012-07-301-1/+1
|
* Add more locale-specific functions to the relevant man pages and Makefile:issyl02012-07-306-14/+86
| | | | | | | | | | | | - lib/libc/locale/islower.3 - lib/libc/locale/ispunct.3 - lib/libc/locale/nl_langinfo.3 - lib/libc/locale/isgraph.3 - lib/libc/locale/isspace.3 Reviewed by: bz Approved by: theraven MFC after: 5 days
* Start manpage with Dd macro and also remove a trailing whitespacejoel2012-07-261-2/+2
| | | | while here.
* Add a new man page containing details of new locale-specific functions forissyl02012-07-252-1/+182
| | | | | | | | wctype.h, iswalnum_l(3). Add it and its functions to the Makefile. Reviewed by: gavin, jilles Approved by: theraven MFC after: 5 days
* Restore the __collate_load_error global that was accidentally removed in thetheraven2012-07-062-5/+6
| | | | | | xlocale refactoring. MFC after: 1 week
* ctype_l(3): Note that not all these functions are specified by POSIX.1-2008.jilles2012-07-011-1/+14
| | | | | | | The function isascii_l() is not in POSIX even though isascii() is, probably because isascii() is marked as obsolete. The other functions, like digittoint_l() and ishexnumber_l(), are FreeBSD-specific just like their non-_l versions.
* Fix a leak when setting the global character locale to "C" from something else.theraven2012-06-111-7/+13
| | | | Reported by: mm
* General mdoc(7) and typo fixes.gjb2012-05-116-9/+9
| | | | | | PR: 167734 Submitted by: Nobuyuki Koganemaru (kogane!jp.freebsd.org) MFC after: 3 days
* Fix copy/paste error in lib/libc/locale/toupper.c.dim2012-05-101-1/+1
| | | | Submitted by: Kohji Okuno <okuno.kohji@jp.panasonic.com>
* Fix some incorrect symbol versions.theraven2012-04-221-4/+4
| | | | Reported by: das
* mdoc: fix function type.joel2012-04-071-1/+1
|
* mdoc: fix column names, indentation, column separation within each row, andjoel2012-04-0711-96/+97
| | | | | | | quotation. Also make sure we have the same amount of columns in each row as the number of columns we specify in the head arguments. Reviewed by: brueffer
* Remove trailing whitespace per mdoc lint warningeadler2012-03-297-8/+8
| | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days
* mdoc: remove unknown macro.joel2012-03-262-2/+0
|
* mdoc: remove empty lines.joel2012-03-262-2/+0
|
* mdoc: document title should be all caps.joel2012-03-251-1/+1
|
* Make sure sections are sorted into conventional order.joel2012-03-252-24/+24
|
* Remove superfluous paragraph macro.joel2012-03-2510-10/+0
|
* Make __get_locale() static inline, not just inline, so when compiling libc intheraven2012-03-191-1/+1
| | | | | | debug mode (without optimisations) it doesn't generate a linker failure. Approved by: dim (mentor)
* First set of xlocale man pages. More to follow...theraven2012-03-1310-2/+223
| | | | Approved by: dim (mentor)
* More xlocale cleanups.theraven2012-03-131-0/+4
| | | | Approved by: dim (mentor)
* Fix build of libc.so after r232620. This caused a duplicate definitiondim2012-03-061-0/+6
| | | | | | of __getCurrentRuneLocale(). Pointy hat to: me
* Remove some duplicated copyright notices.theraven2012-03-061-5/+0
| | | | Approved by: dim (mentor)
* Reapply 227753 (xlocale cleanup), plus some fixes so that it passes buildtheraven2012-03-045-29/+115
| | | | | | universe with gcc. Approved by: dim (mentor)
* Revert r231673 and r231682 for now, until we can run a full makedim2012-02-145-115/+29
| | | | | | universe with them. Sorry for the breakage. Pointy hat to: me and brooks
* Fix a misplaced __NO_TLS locations, and change a GNUism to a C11ism fortheraven2012-02-142-3/+5
| | | | | | consistency. Approved by: brooks (mentor)
* Cleanup of xlocale:theraven2012-02-145-29/+113
| | | | | | | | | | | | | | | | - Address performance regressions encountered by das@ by caching per-thread data in TLS where available. - Add a __NO_TLS flag to cdefs.h to indicate where not available. - Reorganise the xlocale.h definitions into xlocale/*.h so that they can be included from multiple places. - Export the POSIX2008 subset of xlocale when POSIX2008 says it should be exported, independently of whether xlocale.h is included. - Fix the bug where programs using ctype functions always assumed ASCII unless recompiled. - Fix some style(9) violations. Reviewed by: brooks (mentor) Approved by: dim (mentor)
* wctob() returns EOF and not WEOF.delphij2012-02-141-2/+2
| | | | | Noticed by: Zhihao Yuan <lichray gmail com> MFC after: 1 week
* libc: Eliminate some relative relocations in setlocale().jilles2011-12-271-1/+1
|
* libc: Eliminate 13 relative relocations in wctype().jilles2011-12-051-26/+45
|
* Split sentences at period boundaries.obrien2011-12-027-73/+93
|
* Fix a crash when trying to duplicate a locale that contains some implicit C ↵theraven2011-11-221-1/+6
| | | | | | | locale components. Reported by: Michael Butler Approved by: dim (mentor)
OpenPOWER on IntegriCloud