]> granicus.if.org Git - recode/log
recode
6 years agoAdd more suppressions
Reuben Thomas [Mon, 29 Jan 2018 14:41:08 +0000 (14:41 +0000)]
Add more suppressions

Use of subprocess module seems to tickle Valgrind, so activate some existing
leak suppressions and add some more.

6 years agoAppVeyor: install msys cython packages
Reuben Thomas [Mon, 29 Jan 2018 13:48:04 +0000 (13:48 +0000)]
AppVeyor: install msys cython packages

They are available after all.

Add MINGW_BITS setting for MSYS for future use (currently disabled as
there’s no msys-flavour cython).

6 years agoAppVeyor: configure with --enable-silent-rules for shorter logs
Reuben Thomas [Mon, 29 Jan 2018 13:47:20 +0000 (13:47 +0000)]
AppVeyor: configure with --enable-silent-rules for shorter logs

Also just go straight into make distcheck, no need to run just make [all]
first.

6 years agoAppVeyor: don’t try to build on msys, no cython available there
Reuben Thomas [Mon, 29 Jan 2018 13:47:04 +0000 (13:47 +0000)]
AppVeyor: don’t try to build on msys, no cython available there

6 years agoAdd some gitignore patterns for Windows
Reuben Thomas [Mon, 29 Jan 2018 13:45:52 +0000 (13:45 +0000)]
Add some gitignore patterns for Windows

6 years agotests/Makefile.am: add EXEEXT suffix to RECODE for Windows
Reuben Thomas [Mon, 29 Jan 2018 13:52:21 +0000 (13:52 +0000)]
tests/Makefile.am: add EXEEXT suffix to RECODE for Windows

It is only needed when running from Python.

6 years agocommon.py: use subprocess.check_output instead of os.popen
Reuben Thomas [Mon, 29 Jan 2018 13:51:16 +0000 (13:51 +0000)]
common.py: use subprocess.check_output instead of os.popen

This is more long-winded, but os.popen doesn't seem to work with
Unix-style paths on Windows.

6 years agomacOS Travis fix: Cython extension needs installed librecode
Reuben Thomas [Sun, 28 Jan 2018 19:07:38 +0000 (19:07 +0000)]
macOS Travis fix: Cython extension needs installed librecode

6 years agoouter.c: fix some incorrect casts when passing pointers to free
Reuben Thomas [Sun, 28 Jan 2018 18:39:04 +0000 (18:39 +0000)]
outer.c: fix some incorrect casts when passing pointers to free

6 years agoAdd missing includes of locale.h
Reuben Thomas [Sun, 28 Jan 2018 00:49:10 +0000 (00:49 +0000)]
Add missing includes of locale.h

6 years agomerged.c: include config.h
Reuben Thomas [Sat, 27 Jan 2018 23:21:24 +0000 (23:21 +0000)]
merged.c: include config.h

6 years agoTravis update
Reuben Thomas [Sat, 27 Jan 2018 21:53:47 +0000 (21:53 +0000)]
Travis update

Don’t install valgrind on macOS, as there’s no suitable python in brew.

Don’t install gettext from source on macOS, as brew’s is new enough.

Simplify some env var setting.

6 years ago.travis.yml: macOS: make keg-only formulæ available to the build
Reuben Thomas [Sat, 27 Jan 2018 18:28:23 +0000 (18:28 +0000)]
.travis.yml: macOS: make keg-only formulæ available to the build

6 years agoTravis: configure --enable-silent-rules, to make overall logs shorter
Reuben Thomas [Sat, 27 Jan 2018 14:21:17 +0000 (14:21 +0000)]
Travis: configure --enable-silent-rules, to make overall logs shorter

6 years agorequest.c: zero realloc’d memory
Reuben Thomas [Sat, 27 Jan 2018 14:14:46 +0000 (14:14 +0000)]
request.c: zero realloc’d memory

For some reason this was being found by Valgrind on Travis, but not on my
dev machine.

6 years agorequest.c: slight simplification of code to handle malloc failure
Reuben Thomas [Sat, 27 Jan 2018 14:14:15 +0000 (14:14 +0000)]
request.c: slight simplification of code to handle malloc failure

6 years agoRemove redundant memset calls zeroing memory
Reuben Thomas [Sat, 27 Jan 2018 13:57:24 +0000 (13:57 +0000)]
Remove redundant memset calls zeroing memory

Now that ALLOC uses calloc.

Also replace a use of malloc then memset with calloc.

6 years agoFix building of lat1{ansel,iso5426}.h from respective .l files
Reuben Thomas [Sat, 27 Jan 2018 13:26:30 +0000 (13:26 +0000)]
Fix building of lat1{ansel,iso5426}.h from respective .l files

6 years agotask.c: slightly improve code and comments
Reuben Thomas [Sat, 27 Jan 2018 12:43:15 +0000 (12:43 +0000)]
task.c: slightly improve code and comments

This is the fruit of an aborted investigation into using pipes all the
time (it won’t work with the present architecture with translations into a
buffer).

It could be achieved by either a) adding one more stage to write to a file,
and having the parent process read that back, or b) adding an extra pipe
back to the parent process, but that would then require non-blocking I/O,
which would involve i) a new type of communication channel (e.g. file
descriptors), and ii) reimplementation, if desired, of buffering.

An overall simpler and more portable solution would be to convert the
parallel code to use threads instead of child processes, so that the output
buffer would remain accessible to the parent process.

6 years agoGet rid of SET_SUBTASK_ERROR macro; use identical recode_if_nogo function
Reuben Thomas [Fri, 26 Jan 2018 21:49:20 +0000 (21:49 +0000)]
Get rid of SET_SUBTASK_ERROR macro; use identical recode_if_nogo function

The function was used much more than the macro anyway.

6 years agorequest.c: improve error reporting
Reuben Thomas [Fri, 26 Jan 2018 21:47:22 +0000 (21:47 +0000)]
request.c: improve error reporting

Make guarantee_nul_terminator report success/failure, and use this value in
its callers.

Add an extra FIXME to scan_options to explain what needs doing there to
report errors.

6 years agonames.c: fix FIXME: retype to avoid ugly casts for argmatch use
Reuben Thomas [Fri, 26 Jan 2018 21:27:33 +0000 (21:27 +0000)]
names.c: fix FIXME: retype to avoid ugly casts for argmatch use

6 years agoFix FIXME: use sigaction instead of signal
Reuben Thomas [Fri, 26 Jan 2018 21:12:12 +0000 (21:12 +0000)]
Fix FIXME: use sigaction instead of signal

Using signal to set a handler is non-portable (according to POSIX! sigh…).

6 years agohtml.c: add explanation to FIXME
Reuben Thomas [Fri, 26 Jan 2018 21:02:31 +0000 (21:02 +0000)]
html.c: add explanation to FIXME

Outputting a BOM into HTML is marked “experimental”. Since there are
situations in which a BOM should not be output, this seems right. Needs
further evaluation.

6 years agoouter.c: fix FIXME: add diagnostic
Reuben Thomas [Fri, 26 Jan 2018 21:01:41 +0000 (21:01 +0000)]
outer.c: fix FIXME: add diagnostic

recode_error can safely be called with NULL outer, and is elsewhere.

6 years agoUpdate po files
Reuben Thomas [Fri, 26 Jan 2018 13:46:59 +0000 (13:46 +0000)]
Update po files

6 years agoAdd more aliases for KOI-8R: RFC 1489 and IBM CP866
Reuben Thomas [Fri, 26 Jan 2018 13:24:47 +0000 (13:24 +0000)]
Add more aliases for KOI-8R: RFC 1489 and IBM CP866

These were commented out. There were also translation tables, but iconv
provides this functionality, so remove them.

6 years agoRun tests with valgrind
Reuben Thomas [Thu, 25 Jan 2018 09:52:41 +0000 (09:52 +0000)]
Run tests with valgrind

Use the valgrind-python.supp suppressions file (latest version from cpython
git), adding wildcard * to end of PyObject_Realloc name to match LTO
symbols. However, even this is not currently enough to run with the standard
/usr/bin/python, so use /usr/bin/python-dbg instead, which does work (with
some extra suppressions). See https://bugs.python.org/issue32666

Remove a bogus setting of PYTHON in tests/Makefile.am

6 years agoFix a potential memory leak in declare_single
Reuben Thomas [Fri, 26 Jan 2018 12:11:33 +0000 (12:11 +0000)]
Fix a potential memory leak in declare_single

6 years agoFix memory leaks
Reuben Thomas [Fri, 26 Jan 2018 11:49:06 +0000 (11:49 +0000)]
Fix memory leaks

Use the existing, but unused, term_routine member of struct recode_step to
register finalisers.

Also add step_table_term_routine, as adding separate finalisers for
different table types is nicer than having to add finalisers for a huge
number of transformers.

Zero-initialise all allocated memory, so we can assume it, and as a
defensive measure.

Move struct ucs2_to_byte from recodext.h into recode.c, its only user.

6 years agocombine.c: minor English fixes in comments
Reuben Thomas [Thu, 25 Jan 2018 16:06:46 +0000 (16:06 +0000)]
combine.c: minor English fixes in comments

6 years agocombine.c: fix missing white space
Reuben Thomas [Thu, 25 Jan 2018 15:37:38 +0000 (15:37 +0000)]
combine.c: fix missing white space

6 years agoRecode.pyx: fix space leaks in Request and Task
Reuben Thomas [Thu, 25 Jan 2018 14:55:35 +0000 (14:55 +0000)]
Recode.pyx: fix space leaks in Request and Task

Incidentally use a more modern way to import the FILE type

6 years agorequest.c: remove a FIXME
Reuben Thomas [Thu, 25 Jan 2018 14:28:54 +0000 (14:28 +0000)]
request.c: remove a FIXME

We don’t need to worry about always ensuring 4 NULs at the end of a buffer
when we might only need 1 or 2.

6 years agosrc/Makefile.am: distribute generated header files
Reuben Thomas [Thu, 25 Jan 2018 09:57:19 +0000 (09:57 +0000)]
src/Makefile.am: distribute generated header files

6 years agoTravis: switch off verbose build
Reuben Thomas [Thu, 25 Jan 2018 09:56:09 +0000 (09:56 +0000)]
Travis: switch off verbose build

Comment it out for debugging use, but for now it makes the logs too long to
read in the nice web presentation (instead one is forced to read the raw
logs), and the Recode test system shouldn’t need verbose logging.

6 years agoRemove ifdeffed-out alias of ‘.’ for ‘RFC 1345’
Reuben Thomas [Tue, 23 Jan 2018 23:37:40 +0000 (23:37 +0000)]
Remove ifdeffed-out alias of ‘.’ for ‘RFC 1345’

Although we will probably not implement ‘.’ to mean “guess the charset” as
suggested in the comment, there’s also no reason to have a catch-all alias
for RFC 1345 now, when iconv would be a better choice.

6 years agoResolve discrepancies between IBM-PC and ibm437
Reuben Thomas [Tue, 23 Jan 2018 23:32:23 +0000 (23:32 +0000)]
Resolve discrepancies between IBM-PC and ibm437

Unfortunately, there appear to be one error and an arguable gap in RFC 1345,
so retain the IBM-PC charset, and document the differences.

6 years agoRemove lat1 alias for Latin-1 (compatibility with Recode 3.2)
Reuben Thomas [Tue, 23 Jan 2018 22:40:20 +0000 (22:40 +0000)]
Remove lat1 alias for Latin-1 (compatibility with Recode 3.2)

That was a very long time ago.

6 years agoMake test diffs go the logical way round: from expected to output
Reuben Thomas [Tue, 23 Jan 2018 22:36:43 +0000 (22:36 +0000)]
Make test diffs go the logical way round: from expected to output

6 years agoRemove built-in applemac module
Reuben Thomas [Tue, 23 Jan 2018 22:26:42 +0000 (22:26 +0000)]
Remove built-in applemac module

Resolve differences with RFC 1345 code. They were caused simply by extra
characters in the latter missing from the former (I compared the two tables
character by character, by eye).

6 years agoAdd LaTeX translations for <, > and ^ (Debian bug #24436)
Reuben Thomas [Tue, 23 Jan 2018 21:50:06 +0000 (21:50 +0000)]
Add LaTeX translations for <, > and ^ (Debian bug #24436)

6 years agofixup ANSEL
Reuben Thomas [Tue, 23 Jan 2018 21:44:08 +0000 (21:44 +0000)]
fixup ANSEL

6 years agoManual: document ANSEL and ISO 5426 support
Reuben Thomas [Tue, 23 Jan 2018 21:30:12 +0000 (21:30 +0000)]
Manual: document ANSEL and ISO 5426 support

6 years agoManual: update portability notes
Reuben Thomas [Tue, 23 Jan 2018 21:29:07 +0000 (21:29 +0000)]
Manual: update portability notes

Mostly remove a section on improving portability, as these days we can
safely assume C99 support.

Also, no longer claim the library is still under development.

6 years agoManual: remove some references to past and future versions of Recode
Reuben Thomas [Tue, 23 Jan 2018 21:03:31 +0000 (21:03 +0000)]
Manual: remove some references to past and future versions of Recode

The past versions are long-dead; the future versions will probably not come
in the shape predicted.

6 years agoManual: some language fixes
Reuben Thomas [Tue, 23 Jan 2018 21:02:22 +0000 (21:02 +0000)]
Manual: some language fixes

6 years agoManual: overhaul and simplify sequencing method description
Reuben Thomas [Tue, 23 Jan 2018 07:24:56 +0000 (07:24 +0000)]
Manual: overhaul and simplify sequencing method description

6 years agoManual: bump copyright dates
Reuben Thomas [Tue, 23 Jan 2018 07:01:16 +0000 (07:01 +0000)]
Manual: bump copyright dates

6 years agoNEWS: add more for 3.7, bump copyright date, fix a typo
Reuben Thomas [Tue, 23 Jan 2018 07:01:04 +0000 (07:01 +0000)]
NEWS: add more for 3.7, bump copyright date, fix a typo

6 years agoAdd get_bytes and put_bytes
Reuben Thomas [Tue, 23 Jan 2018 06:48:48 +0000 (06:48 +0000)]
Add get_bytes and put_bytes

This allows transform_mere_copy to be made efficient in the case of writing
to buffer.

6 years agoAllow pipe filters to signal when they are interrupted again
Reuben Thomas [Mon, 22 Jan 2018 23:35:27 +0000 (23:35 +0000)]
Allow pipe filters to signal when they are interrupted again

Make the interrupted variable, previously static in main,
recode_interrupted, defined in task.c (hence in librecode), so that it can
now be tested at the end of a pipe recode.

6 years agomain.c: clarify a comment slightly
Reuben Thomas [Mon, 22 Jan 2018 23:35:15 +0000 (23:35 +0000)]
main.c: clarify a comment slightly

6 years agoRemove --sequence=files
Reuben Thomas [Mon, 22 Jan 2018 22:22:09 +0000 (22:22 +0000)]
Remove --sequence=files

Assume that any reasonable target OS has virtual memory (on which holding
the data in memory has much the same performance implications as using
files).

6 years agorecodext.h: clarify a comment
Reuben Thomas [Mon, 22 Jan 2018 20:46:09 +0000 (20:46 +0000)]
recodext.h: clarify a comment

6 years agoUse mkstemps to make temporary file names
Reuben Thomas [Mon, 22 Jan 2018 20:42:18 +0000 (20:42 +0000)]
Use mkstemps to make temporary file names

Remove system-specific code.

6 years agotask.c: improve English in a comment
Reuben Thomas [Mon, 22 Jan 2018 20:40:46 +0000 (20:40 +0000)]
task.c: improve English in a comment

6 years agoUse xbinary-io gnulib module to set mode of stdin/stdout
Reuben Thomas [Mon, 22 Jan 2018 13:40:41 +0000 (13:40 +0000)]
Use xbinary-io gnulib module to set mode of stdin/stdout

Also isatty module to detect ttys. No longer need DOS/Windows/etc.-specific
ifdefs.

6 years agotask.c: handle any number of steps, including zero, in perform_sequence
Reuben Thomas [Mon, 22 Jan 2018 01:48:18 +0000 (01:48 +0000)]
task.c: handle any number of steps, including zero, in perform_sequence

Reduce duplication further, increase ugliness a little.

6 years agotask.c: fold perform_pipe_sequence into perform_sequence
Reuben Thomas [Mon, 22 Jan 2018 01:10:23 +0000 (01:10 +0000)]
task.c: fold perform_pipe_sequence into perform_sequence

The result is large and ugly, but much less duplication overall.

The refactoring was done mechanically, to ensure correctness of the result.
It should be possible to simplify further.

6 years agotask.c: make “correct” version of perform_pipe_sequence work
Reuben Thomas [Sun, 21 Jan 2018 23:17:04 +0000 (23:17 +0000)]
task.c: make “correct” version of perform_pipe_sequence work

Finish converting the right-to-left pipeline into a left-to-right version.

6 years agoOverhaul error handling in transform steps (fixes Debian bug #215285)
Reuben Thomas [Sat, 20 Jan 2018 00:01:53 +0000 (00:01 +0000)]
Overhaul error handling in transform steps (fixes Debian bug #215285)

Three main principles were applied:

1. Check all return codes (this fixes Debian bug #215285, data is lost when
no space left on device).
2. Ensure that resources are not leaked (memory and file descriptors).
3. Consistently use the recode error signalling mechanism: rather than
arbitrarily signalling failure on an I/O error, set error level
RECODE_SYSTEM_ERROR, and signal failure according to fail_level.

It proved to be useful to merge perform_{memory,pass}_sequence.

6 years agoAdd some missing sources to the loc target
Reuben Thomas [Sat, 20 Jan 2018 00:09:08 +0000 (00:09 +0000)]
Add some missing sources to the loc target

6 years agomain.c: fix a comment typo
Reuben Thomas [Fri, 19 Jan 2018 13:33:23 +0000 (13:33 +0000)]
main.c: fix a comment typo

6 years agoRemove if before free
Reuben Thomas [Fri, 19 Jan 2018 12:46:06 +0000 (12:46 +0000)]
Remove if before free

6 years agohtml.c: improve some comments slightly
Reuben Thomas [Fri, 19 Jan 2018 12:45:03 +0000 (12:45 +0000)]
html.c: improve some comments slightly

6 years agoUse briefer form for setting up modules
Reuben Thomas [Fri, 19 Jan 2018 00:17:41 +0000 (00:17 +0000)]
Use briefer form for setting up modules

Use consistently everywhere possible.

6 years agoAdd BibTeX converters from Vincent Danjean (Debian bug #402031)
Reuben Thomas [Fri, 19 Jan 2018 00:01:46 +0000 (00:01 +0000)]
Add BibTeX converters from Vincent Danjean (Debian bug #402031)

6 years agotask.c: use better code for checking abnormally-terminating child process
Reuben Thomas [Thu, 18 Jan 2018 23:38:41 +0000 (23:38 +0000)]
task.c: use better code for checking abnormally-terminating child process

Use the code that says “Bruno would prefer this”. Assume any compatibility
problems are or can now be solved.

6 years agoAdd ANSEL and ISO 5426 codecs from Wolfram Schneider
Reuben Thomas [Thu, 18 Jan 2018 23:14:22 +0000 (23:14 +0000)]
Add ANSEL and ISO 5426 codecs from Wolfram Schneider

Fixes Debian bug #277571.

6 years agoHACKING.org: simplify explanation of build dependencies
Reuben Thomas [Thu, 18 Jan 2018 23:10:07 +0000 (23:10 +0000)]
HACKING.org: simplify explanation of build dependencies

6 years agoUpdate bug report address everywhere
Reuben Thomas [Thu, 18 Jan 2018 11:02:25 +0000 (11:02 +0000)]
Update bug report address everywhere

6 years agoUse UTF-8 for name of author in --help output
Reuben Thomas [Thu, 18 Jan 2018 01:37:35 +0000 (01:37 +0000)]
Use UTF-8 for name of author in --help output

Also fixes the man page, thus Debian bug #409283.

6 years agoFix -k (fixes Debian bug #607021)
Reuben Thomas [Thu, 18 Jan 2018 01:32:20 +0000 (01:32 +0000)]
Fix -k (fixes Debian bug #607021)

Update manual to reflect differently-presented character set names (output
is cosmetically different).

6 years agoTODO: overhaul
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).

6 years agoDeference symlinked input files (fix Debian bug #349477)
Reuben Thomas [Thu, 18 Jan 2018 00:18:33 +0000 (00:18 +0000)]
Deference symlinked input files (fix Debian bug #349477)

6 years agoTry to diagnose untranslatable input when using iconv
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).

6 years agoRecode.pyx: add methods to set fail_level and abort_level for a task
Reuben Thomas [Wed, 17 Jan 2018 22:48:18 +0000 (22:48 +0000)]
Recode.pyx: add methods to set fail_level and abort_level for a task

6 years agoAdd test for correct error code returned on untranslatable character
Reuben Thomas [Wed, 17 Jan 2018 22:19:38 +0000 (22:19 +0000)]
Add test for correct error code returned on untranslatable character

See Debian bug #348909.

6 years agoRecode.pyx: add method to get error from Task
Reuben Thomas [Wed, 17 Jan 2018 22:15:40 +0000 (22:15 +0000)]
Recode.pyx: add method to get error from Task

6 years agoiconv.c: fix a misspelling in a comment
Reuben Thomas [Wed, 17 Jan 2018 21:33:58 +0000 (21:33 +0000)]
iconv.c: fix a misspelling in a comment

6 years agorecodext.h: clarify Star Trek reference in a comment
Reuben Thomas [Wed, 17 Jan 2018 21:33:32 +0000 (21:33 +0000)]
recodext.h: clarify Star Trek reference in a comment

6 years agoiconv.c: fix comment typo
Reuben Thomas [Wed, 17 Jan 2018 20:46:55 +0000 (20:46 +0000)]
iconv.c: fix comment typo

6 years agot40_java.py: fix qp to Java test
Reuben Thomas [Wed, 17 Jan 2018 14:34:41 +0000 (14:34 +0000)]
t40_java.py: fix qp to Java test

When converting individual characters in Java source, we don’t add BOMs, so
don’t require them in the output.

test_2 ends up only doing one direction, but that’s OK because test_1 does
the other.

6 years agoRecode.pyx: expose RECODE_TASK
Reuben Thomas [Wed, 17 Jan 2018 14:34:15 +0000 (14:34 +0000)]
Recode.pyx: expose RECODE_TASK

Minimal interface for just what we need right now!

6 years agobase64.c: fix handling of EOF and LF (fixes Debian bug #271939)
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.)

6 years agorecodext.h: re-punctuate comment to fix the sense
Reuben Thomas [Wed, 17 Jan 2018 13:11:56 +0000 (13:11 +0000)]
recodext.h: re-punctuate comment to fix the sense

6 years agot40_java.py: spell “Java” correctly (not all upper-case)
Reuben Thomas [Wed, 17 Jan 2018 13:10:41 +0000 (13:10 +0000)]
t40_java.py: spell “Java” correctly (not all upper-case)

6 years agomixed.c: remove “inline” comments from function declarations
Reuben Thomas [Wed, 17 Jan 2018 13:09:32 +0000 (13:09 +0000)]
mixed.c: remove “inline” comments from function declarations

Compilers can work this stuff out for themselves nowadays.

6 years agoRecode.pyx: allow NULs in recoded data
Reuben Thomas [Tue, 16 Jan 2018 11:07:44 +0000 (11:07 +0000)]
Recode.pyx: allow NULs in recoded data

Expose recode_buffer_to_buffer rather than recode_string, and check return
value. This makes some tests fail (see Debian bug #271939)

Add a comment explaining why we prefer the buffer APIs, and don’t bother
with string APIs at all.

Also add a FIXME to expose file APIs.

6 years agoRecode.pyx: minor improvements
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).

6 years agovaria.c: resolve various conflicts
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.

6 years agoutf8.c: remove support for non-standard 32nd bit
Reuben Thomas [Tue, 16 Jan 2018 00:41:33 +0000 (00:41 +0000)]
utf8.c: remove support for non-standard 32nd bit

6 years agonames.c: remove support for dumping hash stats
Reuben Thomas [Tue, 16 Jan 2018 00:38:15 +0000 (00:38 +0000)]
names.c: remove support for dumping hash stats

6 years agonames.c: remove hard-wired define DEFAULT_CHARSET support
Reuben Thomas [Tue, 16 Jan 2018 00:35:33 +0000 (00:35 +0000)]
names.c: remove hard-wired define DEFAULT_CHARSET support

6 years agoatarist.c: remove non-RFC1345 option
Reuben Thomas [Tue, 16 Jan 2018 00:32:55 +0000 (00:32 +0000)]
atarist.c: remove non-RFC1345 option

6 years agocharsets.def: fix missing characters in IBM870
Reuben Thomas [Tue, 16 Jan 2018 00:29:32 +0000 (00:29 +0000)]
charsets.def: fix missing characters in IBM870

Patch from Carey Evans <careye@spamcop.net>

Fixes Debian bug #270414

6 years agoDon’t insist on chmod succeeding for output files
Reuben Thomas [Tue, 16 Jan 2018 00:23:58 +0000 (00:23 +0000)]
Don’t insist on chmod succeeding for output files

Support file systems that lack permissions (e.g. FAT).

Fixes Debian bug #237249.

6 years agomain.c: assume we have rename(3) as it’s standard since C89
Reuben Thomas [Tue, 16 Jan 2018 00:11:25 +0000 (00:11 +0000)]
main.c: assume we have rename(3) as it’s standard since C89

In fact, since my recent changes, HAVE_RENAME was not being defined, so
rename was not used!

6 years agomain.c: fix potential buffer overflow (Debian bug #754945)
Reuben Thomas [Mon, 15 Jan 2018 23:55:16 +0000 (23:55 +0000)]
main.c: fix potential buffer overflow (Debian bug #754945)

Patch from Alexander Gerasiov <gq@debian.org>