aboutsummaryrefslogtreecommitdiff
path: root/lib/libiconv_modules
Commit message (Collapse)AuthorAgeFilesLines
* libiconv: correct undefined behavior.Pedro F. Giffuni2018-07-081-2/+2
| | | | | | | | | | | | | Detected on NetBSD: # nm /usr/lib/libc.so|grep sanit /public/src.git/lib/libc/citrus/modules/citrus_mapper_std.c:173:8: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Obtained from: NetBSD (CVS Rev. 1.11) MFC after: 1 week Notes: svn path=/head/; revision=336115
* iconv: adding missing breakEitan Adler2018-01-211-0/+1
| | | | | | | | | | | | break is probably intended and correct, but has no correctness implications due to is94 => is96 Reviewed by: cem, jilles Reported by: swildner@DragonFlyBSD.org MFC After: 1 week Notes: svn path=/head/; revision=328222
* lib: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2644-0/+88
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. 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. Notes: svn path=/head/; revision=326219
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-203-0/+6
| | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-3123-23/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* lib: initial use of reallocarray(3).Pedro F. Giffuni2017-04-211-2/+2
| | | | | | | | | | | Make some use of reallocarray, attempting to limit it to cases where the parameters are unsigned and there is some theoretical chance of overflow. MFC afer: 2 weeks Differential Revision: https://reviews.freebsd.org/D9980 Notes: svn path=/head/; revision=317265
* Use SRCTOP-relative paths to other directories instead of .CURDIR-relative onesEnji Cooper2017-01-202-3/+3
| | | | | | | | | | This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=312506
* META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.Bryan Drewery2015-11-2523-23/+0
| | | | | | | | | | | This both avoids some dependencies on xinstall.host and allows bootstrapping on older releases to work due to lack of at least 'install -l' support. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291307
* Add more SUBDIR_PARALLEL.Bryan Drewery2015-10-151-0/+1
| | | | | | | | MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=289393
* META_MODE: Remove DEP_RELDIR from Makefile.depend files.Bryan Drewery2015-09-2523-46/+0
| | | | | | | | | This has not been needed since r284171 in projects/bmake. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=288226
* Bump GCC max-inline-insns-single in libiconv_modules and grepPedro F. Giffuni2015-07-266-6/+6
| | | | | | | | | | This is required by our FORTIFY_SOURCE implementation as it does more inlining. As a rule of thumb, FORTIFY_SOURCE doubles the number of inlines except that in grep inlining blows up for some reason. Notes: svn path=/head/; revision=285884
* Add META_MODE support.Simon J. Gerraty2015-06-1323-0/+483
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * Merge sync of headSimon J. Gerraty2015-05-2717-36/+36
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=283595
| * \ Merge head from 7/28Simon J. Gerraty2014-08-191-4/+2
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | | Updated dependenciesSimon J. Gerraty2014-05-1623-0/+138
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | | Merge headSimon J. Gerraty2014-04-2732-52/+95
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265006
| * | | | New/updated dependenciesSimon J. Gerraty2013-10-1723-0/+322
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=256698
* | | | | When only 2 bytes can be read from a 4 byte UTF-16 character in a base64Tijl Coosemans2015-05-241-24/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | encoded chunk of a UTF-7 string, treat that as an incomplete character and return an error instead of a shift sequence and no error. Also check that the low 2 bytes have a valid value. MFC after: 1 week Notes: svn path=/head/; revision=283418
* | | | | Fix decoding of UTF-7 when a base64 encoded chunk appears at the end ofTijl Coosemans2015-05-241-5/+1
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the input buffer. _citrus_UTF7_mbtoutf16 stored the decoder state at the beginning so it could restore this state on an incomplete character such that the next call would restart the decoding. The problem was that "-" (end of base64 mode) at the end of a string was also treated as an incomplete character but was also removed from the state buffer. So the initial state would be restored (with base64 mode) and the next call would no longer see the "-" so it continued in base64 mode. This state saving/restoring isn't needed here. It's already handled elsewhere (citrus_iconv_std.c:_citrus_iconv_std_iconv_convert) so just remove it. Also initialise *nresult. PR: 200398 Tested by: delphij MFC after: 1 week Notes: svn path=/head/; revision=283406
* | | | Remove the const qualifier from iconv(3) to comply with POSIX:Tijl Coosemans2015-04-1517-36/+36
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html Adjust all code that calls iconv. PR: 199099 Exp-run by: antoine MFC after: 2 weeks Notes: svn path=/head/; revision=281550
* | | Replace malloc+memset with calloc.Tijl Coosemans2014-06-131-4/+2
| |/ |/| | | | | Notes: svn path=/head/; revision=267436
* | Spell NO_PROFILE= as MK_PROFILE=no.Warner Losh2014-04-251-1/+1
| | | | | | | | Notes: svn path=/head/; revision=264928
* | - In the libiconv module for ISO 2022 restore the original order of theTijl Coosemans2014-04-019-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fields of a private struct such that variables of this type are initialised correctly. Fixes conversion from ISO 2022. Also do this in the BIG5 module to prevent similar errors in the future. - In the libiconv module for EUC-TW replace 2^cs with 1<<cs. Fixes conversion from EUC-TW. - Synchronise iconv code with NetBSD. In most cases this only updates the RCS id because the changes are already there or are NetBSD specific. + libc/iconv/citrus_csmapper.c: Add a comment. + libc/iconv/citrus_db_factory.c: Remove put16(). + libc/iconv/citrus_iconv.c: Return EINVAL on error. + libc/iconv/citrus_mapper.c: Return EINVAL on error. + libc/iconv/citrus_memstream.c: Fix type of a variable. + libc/iconv/citrus_prop.h: Sync definition of _CITRUS_PROP_HINT_END. + libc/iconv/citrus_stdenc.c: Return EINVAL on error. + libiconv_modules/mapper_std/citrus_mapper_std.c: Plug memory leak. Obtained from: NetBSD MFC after: 2 weeks Notes: svn path=/head/; revision=263986
* | Silence the gcc warning about unsigned comparison with 0 in a differentTijl Coosemans2014-03-011-3/+2
| | | | | | | | | | | | | | | | | | way because mnemonic_ext_size isn't a preprocessor macro. MFC after: 3 days Notes: svn path=/head/; revision=262655
* | Wrap for loop in #if block testing the size is actually greaterXin LI2014-02-251-1/+4
| | | | | | | | | | | | | | | | | | | | than 0. This silences gcc warning. Reviewed by: sha256(1) with clang X-MFC-With: r262447 Notes: svn path=/head/; revision=262464
* | Revert 262462 and 262461, they didn't solve the problem, inXin LI2014-02-251-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | fact I should actually waited the build to be finished before committing. A proper fix would be committed once my test build passes. Pointy hat to: delphij Notes: svn path=/head/; revision=262463
* | Patch 2/2:Xin LI2014-02-241-11/+11
| | | | | | | | | | | | | | | | | | Reindent the code after previous change. X-MFC-With: r262447 Notes: svn path=/head/; revision=262462
* | Patch 1/2:Xin LI2014-02-241-0/+2
| | | | | | | | | | | | | | | | | | | | Pet gcc: enclose the for loop that currently do nothing with an if. Reviewed by: sha256(1) X-MFC-With: r262447 Notes: svn path=/head/; revision=262461
* | Fix an array index out of bounds bug in iconv VIQR (Vietnamese) module.Tijl Coosemans2014-02-241-1/+1
| | | | | | | | | | | | | | | | | | PR: 185964 Submitted by: Manuel Mausz <manuel-freebsd@mausz.at> MFC after: 5 days Notes: svn path=/head/; revision=262447
* | Fix Simplified Chinese character set conversions by switching around theTijl Coosemans2014-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | fields of an internal struct so it corresponds with the way variables of this type are initialised. PR: 185964 Submitted by: Manuel Mausz <manuel-freebsd@mausz.at> MFC after: 5 days Notes: svn path=/head/; revision=262442
* | Consistently pass around context information using a simple pointer. ThisTijl Coosemans2014-02-242-12/+11
| | | | | | | | | | | | | | | | | | | | fixes some dereferencing bugs in Chinese character set conversions. PR: 185964 MFC after: 5 days Notes: svn path=/head/; revision=262441
* | Split the last gcc-specific flags off into CFLAGS.gcc. This alsoDimitry Andric2014-01-0514-14/+14
| | | | | | | | | | | | | | | | | | | | removes the need to use -Qunused-arguments for clang throughout the tree. MFC after: 3 days Notes: svn path=/head/; revision=260334
* | In libiconv_modules, surround unused static _citrus_XXX_pack_state() andDimitry Andric2013-12-2814-0/+28
| | | | | | | | | | | | | | | | | | _citrus_XXX_unpack_state() functions with #if 0, for now. MFC after: 3 days Notes: svn path=/head/; revision=260003
* | Add ICONV_{GET,SET}_ILSEQ_INVALID iconvctl. GNU iconv returns EILSEQHiroki Sato2013-11-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when there is an invalid character in the output codeset while it is valid in the input. However, POSIX requires iconv() to perform an implementation-defined conversion on the character. So, Citrus iconv converts such a character to a special character which means it is invalid in the output codeset. This is not a problem in most cases but some software like libxml2 depends on GNU's behavior to determine if a character is output as-is or another form such as a character entity (&#NNN;). Notes: svn path=/head/; revision=258537
* | Bug fixes in iconv(3) UTF-7 support.Tijl Coosemans2013-11-181-8/+9
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add ' to the list of directly encoded characters and * to the list of optionally directly encoded characters as per RFC 2152. - In _citrus_UTF7_mbtoutf16 on end of input when the next output character has only been partially decoded, save a copy of the buffer of input characters (not just its length). On the next call with more input characters this buffer is reprocessed together with the new input to form a fully decoded output character. - At the end of a base64 encoded sequence fully discard '-' (BASE64_OUT) by decrementing psenc->chlen and i. This is needed to make room in psenc->ch (input buffer) in case the next input character starts a new base64 encoded sequence. And also, if this is the end of input and no output character can be returned, this brings the encoder in the initial state as indicated by _citrus_UTF7_stdenc_get_state_desc_generic which is used by the caller to distinguish between no output and partial output. - In _citrus_UTF7_mbrtowc_priv pass the s parameter (input pointer) directly to _citrus_UTF7_mbtoutf16 instead of a copy (s0). This way s is updated correctly in case of errors. - In _citrus_UTF7_mbrtowc_priv when called with psenc->surrogate set (previous call did not have enough input), retrieve the previously decoded UTF-16 character from (psenc->cache >> psenc->bits) instead of (psenc->cache >> 2). MFC after: 5 days Notes: svn path=/head/; revision=258316
* Use Makefile.inc instead of .export.David Chisnall2013-09-062-3/+3
| | | | Notes: svn path=/head/; revision=255298
* Fix the namespace pollution caused by iconv.h including stdbool.hDavid Chisnall2013-09-061-0/+3
| | | | | | | | This broke any C89 ports that defined bool themselves, including things like gcc, gtk, and so on. Notes: svn path=/head/; revision=255297
* As a followup to r252547, propate const down the call stack.Peter Wemm2013-07-0317-37/+37
| | | | Notes: svn path=/head/; revision=252583
* Add the BSD-licensed Citrus iconv to the base system with default offGabor Kovesdan2011-02-2572-0/+10787
setting. It can be built by setting the WITH_ICONV knob. While this knob is unset, the library part, the binaries, the header file and the metadata files will not be built or installed so it makes no impact on the system if left turned off. This work is based on the iconv implementation in NetBSD but a great number of improvements and feature additions have been included: - Some utilities have been added. There is a conversion table generator, which can compare conversion tables to reference data generated by GNU libiconv. This helps ensuring conversion compatibility. - UTF-16 surrogate support and some endianness issues have been fixed. - The rather chaotic Makefiles to build metadata have been refactored and cleaned up, now it is easy to read and it is also easier to add support for new encodings. - A bunch of new encodings and encoding aliases have been added. - Support for 1->2, 1->3 and 1->4 mappings, which is needed for transliterating with flying accents as GNU does, like "u. - Lots of warnings have been fixed, the major part of the code is now WARNS=6 clean. - New section 1 and section 5 manual pages have been added. - Some GNU-specific calls have been implemented: iconvlist(), iconvctl(), iconv_canonicalize(), iconv_open_into() - Support for GNU's //IGNORE suffix has been added. - The "-" argument for stdin is now recognized in iconv(1) as per POSIX. - The Big5 conversion module has been fixed. - The iconv.h header files is supposed to be compatible with the GNU version, i.e. sources should build with base iconv.h and GNU libiconv. It also includes a macro magic to deal with the char ** and const char ** incompatibility. - GNU compatibility: "" or "char" means the current local encoding in use - Various cleanups and style(9) fixes. Approved by: delphij (mentor) Obtained from: The NetBSD Project Sponsored by: Google Summer of Code 2009 Notes: svn path=/head/; revision=219019