Reuben Thomas [Thu, 18 Jan 2018 00:36:48 +0000 (00:36 +0000)]
TODO: overhaul
Replace François’s email address with mine, remove things that are either
done or seem to refer to personal files of François, and the section on the
MS-DOS port (assumed defunct).
Reuben Thomas [Wed, 17 Jan 2018 22:43:10 +0000 (22:43 +0000)]
Try to diagnose untranslatable input when using iconv
See Debian bug #348909.
The problem starts with the fact that iconv returns EILSEQ (invalid input)
when in fact the input is merely untranslatable.
It is possible to diagnose this situation by running another conversion with
the output encoding the same as the input (so that it will always succeed on
valid input) at the same point. This is what we now do. Unfortunately,
there’s no way I can see to work out how much input to skip (i.e. the length
of the untranslatable character in the source encoding). Hence, we still
just skip one byte. The typical result is that invalid input is diagnosed on
the next step, resulting in the same problem as at present.
Two possible workarounds are to not use iconv, or to set abort_level to
RECODE_UNTRANSLATABLE (this is what test_2 in t80_error.py does).
Reuben Thomas [Wed, 17 Jan 2018 13:13:12 +0000 (13:13 +0000)]
base64.c: fix handling of EOF and LF (fixes Debian bug #271939)
LF can occur before the end of a full line (76 characters) if it’s
immediately followed by EOF.
The last line can be any number of quadruplets long; it need not be 76
characters. (I suspect this was an attempt to deal with LF without the extra
call to get_byte and goto.)
Reuben Thomas [Tue, 16 Jan 2018 10:37:48 +0000 (10:37 +0000)]
Recode.pyx: minor improvements
size_t is supported natively these days, so don’t make a dangerous guess as
to its value (in particular, should never hard-wire things determined in
config.h!).
Use libcpp’s bool instead of hand-defining a bool enum.
Use True for C true (will be automatically coerced).
Reuben Thomas [Tue, 16 Jan 2018 01:06:51 +0000 (01:06 +0000)]
varia.c: resolve various conflicts
Rather than compile-time macros for two different options:
1. Resolve the Kamenický encoding by referring to the Wikipedia version at
https://en.wikipedia.org/wiki/Kamenick%C3%BD_encoding
2. Allow the extra characters in the Cork encoding table.
Also fill in some missing Unicode code points, fixing some FIXMEs.
Reuben Thomas [Sun, 14 Jan 2018 13:03:21 +0000 (13:03 +0000)]
Neither cleaner.h nor recodext.h needs to be generated
So don’t generate them, and move cleaner.h into src; this fixes dependency
tracking, and prevents system headers from installations of librecode being
used erroneously.
Also remove defunct symbols from cleaner.h.
Also fix a wrong dependency: charname.lo depends on charname.h, not
rfc1345.h.
Jiri Popelka [Thu, 23 Jun 2011 13:24:52 +0000 (15:24 +0200)]
Coverity: RESOURCE_LEAK
src/hash.c:783: var_assign: Assigning: "new_table" = storage returned from
"hash_initialize(candidate, table->tuning, table->hasher,
table->comparator, table->data_freer)".
src/hash.c:816: leaked_storage: Variable "new_table" going out of scope
leaks the storage it points to.
src/html.c:428: var_assign: Assigning: "table" = storage returned from
"hash_initialize(0U, NULL, code_hash, code_compare, NULL)".
src/html.c:436: leaked_storage: Variable "table" going out of scope
leaks the storage it points to.
src/html.c:609: var_assign: Assigning: "table" = storage returned from
"hash_initialize(0U, NULL, string_hash, string_compare, NULL)".
src/html.c:617: leaked_storage: Variable "table" going out of scope
leaks the storage it points to.
src/request.c:758: var_assign: Assigning: "new" = storage returned from
"recode_malloc(outer, 16UL)".
src/request.c:768: leaked_storage: Variable "new" going out of scope
leaks the storage it points to.
Jiri Popelka [Thu, 23 Jun 2011 13:11:57 +0000 (15:11 +0200)]
Coverity: UNINIT
src/recode.c:192: var_decl: Declaring variable "right_table" without initializer.
src/recode.c:240: uninit_use_in_call: Using uninitialized value
"right_table[right]" when calling "recode_error".
src/recode.c:191: var_decl: Declaring variable "left_table" without initializer.
src/recode.c:228: uninit_use_in_call: Using uninitialized value
"left_table[left]" when calling "recode_error".
src/recode.c:281: uninit_use: Using uninitialized value "left_table[search]".