Skip to content

Commit

Permalink
doxygen2man: fix printing of lines starting with '.'
Browse files Browse the repository at this point in the history
if a line starts with a '.' (eg the '...' in qbarray.h) then
nroff thinks it's looking for a macro called '..'.

The easiest solution is to add a dummy format at the start of the line
(just adding \ seems not to work).
  • Loading branch information
chrissie-c committed Jan 4, 2021
1 parent 5b16d50 commit 71d75b8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion doxygen2man/doxygen2man.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,14 @@ static cstring_t get_codeline(xmlNode *this_tag)
buffer = cstring_append_chars(buffer, " ");
}
if (strcmp((char*)sub_tag->name, "text") == 0) {
buffer = cstring_append_chars(buffer, (char*)sub_tag->content);
// If the line starts with a dot then escape the first one to
// stop nroff thinking it's a macro
char *tmp = (char*)sub_tag->content;
if (tmp[0] == '.') {
buffer = cstring_append_chars(buffer, (char*)"\\[char46]");
tmp += 1;
}
buffer = cstring_append_chars(buffer, tmp);
}
if (strcmp((char*)sub_tag->name, "ref") == 0) {
// Handled by the child recusion below
Expand Down

0 comments on commit 71d75b8

Please sign in to comment.