Hello Andrej.
I received this report from the Debian BTS.
I'm attaching a patch which I believe it might fix it, but only as a
proof of concept (the patch also fixes two typos in the memsets),
for your review.
Thanks.
----- Forwarded message from James Youngman <[email protected]> -----
Date: Sun, 19 Jul 2026 10:45:53 +0100
From: James Youngman <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: Bug#1142391: indent: First paragraph of manul page has missing text
Package: indent
Version: 2.2.13-7
Severity: minor
>From the manual page:
DESCRIPTION
This man page is generated from the file indent.texinfo. This
is Edition of "The indent Manual", for Indent Version , last
updated .
Notice that the edition information, indent version and last-update
are all simply missing.
[...]
diff --git a/man/texinfo2man.c b/man/texinfo2man.c
index e7b3f22..e13de5c 100644
--- a/man/texinfo2man.c
+++ b/man/texinfo2man.c
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <unistd.h>
/* texinfo2man.
* Convert a texinfo document to man format.
@@ -233,12 +234,12 @@ static void process_texi(
}
if (!strncmp(buf + 5, "EDITION ", 8)) {
- memset(value_updated, 0, sizeof(value_updated));
+ memset(value_edition, 0, sizeof(value_edition));
strncpy(value_edition, buf + 13, sizeof(value_edition) - 1);
}
if (!strncmp(buf + 5, "VERSION ", 8)) {
- memset(value_updated, 0, sizeof(value_updated));
+ memset(value_version, 0, sizeof(value_version));
strncpy(value_version, buf + 13, sizeof(value_version) - 1);
}
@@ -294,9 +295,26 @@ int main(int argc, char *argv[])
texinfoname = argv[2];
- in = fopen (argv[2], "r");
- process_texi (in);
- fclose (in);
+ {
+ char saved_cwd[4096];
+ char *slash = strrchr (argv[2], '/');
+ int need_chdir = 0;
+
+ if (slash)
+ {
+ if (!getcwd (saved_cwd, sizeof (saved_cwd))) saved_cwd[0] = 0;
+ *slash = '\0';
+ need_chdir = (chdir (argv[2]) == 0);
+ *slash = '/';
+ }
+
+ in = fopen (argv[2], "r");
+ process_texi (in);
+ fclose (in);
+
+ if (need_chdir && saved_cwd[0])
+ chdir (saved_cwd);
+ }
in = fopen (argv[1], "r");