0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-08-24 10:22:43 +00:00
Files
termux-packages/packages/mandoc/fix-missing-title.patch
Robert Kirkman 943d256d6f fix(main/mandoc): if the manpage title is empty, set it to "UNTITLED"
- Fixes https://github.com/termux/termux-packages/issues/25261

- Patch created by upstream mandoc developer Ingo Schwarze and copied and pasted from here https://marc.info/?l=mandoc-discuss&m=175200050325256&w=2

- **However**, while Ingo Schwarze confirmed that a bug in mandoc was present, he described `pandoc` critically, and stated that `pandoc` exacerbated the issue by generating a poorly converted manpage. This is the difference that made the `adb` manpage affected by the problem, but not other manpages.

0c4d79943e/.github/workflows/build.yml (L32)

2c2daf3987/packages/android-tools/build.sh (L8)

Co-authored-by: Ingo Schwarze <schwarze@usta.de>
2025-07-10 18:28:27 -05:00

28 lines
959 B
Diff

This patch was created by Ingo Schwarze <schwarze@usta.de>
and taken from https://marc.info/?l=mandoc-discuss&m=175200050325256&w=2
Fixes https://github.com/termux/termux-packages/issues/25261
--- a/man_validate.c 1 Jul 2025 20:06:13 -0000 1.130
+++ b/man_validate.c 8 Jul 2025 18:34:33 -0000
@@ -479,7 +479,7 @@ post_TH(CHKARGS)
/* ->TITLE<- MSEC DATE OS VOL */
n = n->child;
- if (n != NULL && n->string != NULL) {
+ if (n != NULL && n->string != NULL && *n->string != '\0') {
for (p = n->string; *p != '\0'; p++) {
/* Only warn about this once... */
if (isalpha((unsigned char)*p) &&
@@ -492,8 +492,8 @@ post_TH(CHKARGS)
}
man->meta.title = mandoc_strdup(n->string);
} else {
- man->meta.title = mandoc_strdup("");
- mandoc_msg(MANDOCERR_TH_NOTITLE, nb->line, nb->pos, "TH");
+ man->meta.title = mandoc_strdup("UNTITLED");
+ mandoc_msg(MANDOCERR_DT_NOTITLE, nb->line, nb->pos, "TH");
}
/* TITLE ->MSEC<- DATE OS VOL */