71 Commits

Author SHA1 Message Date
Kevin Boone
0fbee89e89 Merge pull request #42 from imix/optimize-wstring_length
optimize wstring_length
2025-11-20 12:10:03 +00:00
Stefan Aeschbacher
ef6b3fcb38 add len to WString 2025-11-20 11:39:14 +01:00
Kevin Boone
3901e76f4f Merge pull request #41 from CrispStrobe/macos-compile-fix
Fix macOS compilation issues for strdup and asprintf
2025-05-31 17:11:56 +01:00
CrispStrobe
60b3494d89 Fix macOS compilation issues for strdup and asprintf
- Renamed local string library (string.c/h) to custom_string.c/h
  to avoid conflicts with system <string.h>.
- Updated include directives for the renamed string library.
- Ensured custom_string.c includes custom_string.h.
- Adjusted feature test macros in epub2txt.c (_POSIX_C_SOURCE, _GNU_SOURCE).
- Added an explicit prototype for asprintf in epub2txt.c to resolve
  undeclared function errors on macOS/Clang.
2025-05-30 16:14:02 +02:00
Kevin Boone
10403a533e Merge pull request #40 from martinjuhasz/patch-1
Update README.MACOS.md
2025-02-27 14:42:55 +00:00
Martin Juhasz
45d6ede09b Update README.MACOS.md
macos `install` does not support the -D flag. 
I've added the creation of the folders into the install command
2025-02-27 14:36:53 +01:00
Kevin Boone
e0060046e0 Merge pull request #32 from Nekotekina/patch-1
Add <ruby> support for asian languages
2024-12-19 08:57:49 +00:00
kevinboone
1989cd8452 Added --separator 2024-12-19 08:52:24 +00:00
Kevin Boone
7c69cc2216 Merge pull request #35 from axmonti/master
Add MACOS.README.md
2024-12-09 09:50:58 +00:00
axmonti
a356750cf5 Update README.MACOS.md
Correct typos and improve readability.
2024-12-09 00:08:50 -06:00
axmonti
2118021cba Add MACOS.README.md 2024-12-08 23:40:01 -06:00
Ivan
461d14141d Add <ruby> support for asian languages
Reformat ruby annotations in braces.
Before: `01day.01month.1999year`
After: `01.01.1999(daymonthyear)`
This is mainly intended for asian languages, Japanese for example, where current handling of ruby creates a mix of words and readings. With this patch, readings are put in braces after words, improving readability.
2024-11-05 18:13:06 +03:00
Kevin Boone
3ce598e0ef Merge pull request #31 from Querela/fix/termux-canonicalize-file-path
Fix unknown canonicalize_file_path on termux
2024-09-30 14:20:27 +01:00
Querela
609a504982 Fix unknown canonicalize_file_path() on termux
- update comments
- add feature test macro, see https://github.com/kevinboone/epub2txt2/pull/31#issuecomment-2378087151
2024-09-27 21:16:11 +02:00
Marco Bonelli
7015c64abd Fix missing signal handler argument name 2024-09-15 00:18:45 +02:00
Kevin Boone
69a2c2f78c Fixed a security flaw with broken EPUBs 2024-09-14 19:13:47 +01:00
Kevin Boone
54de917040 Merge pull request #25 from mebeim/master
Sanitize EPUB paths and skip invalid ones
2024-09-14 19:07:08 +01:00
Kevin Boone
ecc059369c Improved failure mode with certain corrupt EPUBs 2024-08-17 09:43:53 +01:00
Kevin Boone
67b1308fbd Fixed memory management warning v2.08 2024-06-18 20:14:13 +01:00
Kevin Boone
13dc22cfba Removed position-independent code settings from defaults 2024-06-18 14:57:23 +01:00
Kevin Boone
5856ff5330 Improved clean-up v2.07 2024-06-18 13:36:05 +01:00
Kevin Boone
6fd1a332a6 Test fix for bug #26 2023-05-03 21:35:42 +01:00
Kevin Boone
0e31500990 Added support for 'br /' tag 2023-04-29 17:39:43 +01:00
Marco Bonelli
f2e35e6d21 Sanitize EPUB paths and skip invalid ones
Paths specified in href attributes inside an EPUB could potentially
point outside the EPUB container (e.g. href="../../../../outside").
Make sure this does not happen: abort parsing if the rootfile points
outside the EPUB container and skip parsing files with invalid paths,
printing a warning.
2022-07-01 03:10:23 +02:00
Kevin Boone
54b41e8715 Fixed handling of URL-encoded spine hrefs 2022-06-30 15:41:59 +01:00
Kevin Boone
ac4e73fa79 Consolidated release 2.06 v2.06 2022-06-30 09:48:08 +01:00
Kevin Boone
df26e42dc7 Minor doc update 2022-06-30 09:37:25 +01:00
Kevin Boone
b00d7c05d3 Merge branch 'mebeim-master' 2022-05-20 09:48:26 +01:00
Kevin Boone
945fe921db Merge branch 'master' of https://github.com/mebeim/epub2txt2 into mebeim-master 2022-05-20 09:46:06 +01:00
Kevin Boone
40b8cf3211 Small doc changes 2022-05-20 09:33:03 +01:00
Kevin Boone
e07be902d2 Fixed another bug in metadata handling 2022-05-19 13:15:51 +01:00
Kevin Boone
b771086b18 Minor documentation updates 2022-05-19 09:26:00 +01:00
Kevin Boone
7aea09acee Fixed bug in handling null metadata v2.05 2022-05-19 08:49:17 +01:00
Kevin Boone
02f69e6243 Fixed problem with UTF-8 BOM v2.04 2022-04-13 09:51:39 +01:00
Marco Bonelli
1a5e44c2cb Use execvp instead of system to run helper commands
While easier to use, system() has the disadvantage of needing proper
escaping and validation on the passed parameter, which is passed
as is to a shell, in order to avoid malformed commands and possibly
execution of unwanted commands (command injection).

Add an utility function for running helper commands that uses fork()
+ execvp() + wait() instead of system(). Using execvp() has the
advantage of not needing any escaping on the parameters, and the
interface is also easier to use as ther is no need to construct
commands as a single string using sprintf() or similar functions.
2022-03-28 12:10:58 +02:00
Marco Bonelli
1f86729595 Properly handle temporary directory paths
In epub2txt_do_file(), the environment variables TMP and TMPDIR are
used as a base to construct the path for a temporary directory to
extract the EPUB contents into. A long enough value for TMP or TMPDIR
will overrun the fixed-size buffers allocated on the stack of the
function and break the program.

Dynamically allocate strings to avoid buffer overruns, and return early
when mkdir() fails, as there isn't much else to do.
2022-03-28 12:09:15 +02:00
Kevin Boone
973ffba2f4 Merge pull request #20 from bmwiedemann/sort
Sort input file list
2022-03-22 12:51:03 +00:00
Bernhard M. Wiedemann
e2e366c0b3 Sort input file list
so that `epub2txt` builds in a reproducible way
in spite of indeterministic filesystem readdir order

See https://reproducible-builds.org/ for why this is good.
2022-03-18 19:51:22 +01:00
Kevin Boone
002e1859b4 Added licence boilerplate 2022-03-13 10:37:30 +00:00
Kevin Boone
10e9ac86df Fixed buffer overrun bug 2022-01-25 12:17:34 +00:00
Kevin Boone
71dc4199e8 Respect TMPDIR 2021-04-21 21:22:34 +01:00
Kevin Boone
6df99fc54f Added signal.h 2021-01-25 19:08:26 +00:00
Kevin Boone
911e28056a Fixed stupid HTML entity bug 2020-07-19 17:31:06 +01:00
Kevin Boone
88e8889497 Improved Makefile 2020-07-19 08:42:38 +01:00
Kevin Boone
c91809bcc7 Fix problem with quote handling in filenames 2020-07-19 08:25:42 +01:00
Kevin Boone
532e275655 Updated copyright information 2020-05-18 15:28:38 +01:00
Kevin Boone
b317dbc241 Updated XML parser 2020-05-18 15:23:08 +01:00
Kevin Boone
e9099290aa Merge pull request #8 from rajeevvp/master
Turn ANSI terminal-highlighting off and on at EOLs for pagers like less(1).
2020-02-01 06:53:58 +00:00
rajeevvp
c7ac8796e8 Turn ANSI-terminal highlighting on and off at EOLs. 2020-02-01 08:07:18 +05:30
rajeevvp
0fbf14b89f Replace one ugly upcall with *2* ugly upcalls. 2020-02-01 07:58:46 +05:30