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 9bd9945
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doxygen2man/doxygen2man.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ static cstring_t get_codeline(xmlNode *this_tag)
buffer = cstring_append_chars(buffer, " ");
}
if (strcmp((char*)sub_tag->name, "text") == 0) {
// If the line starts with a dot then put a dummy format to
// stop nroff thinking it's a macro
char *tmp = (char*)sub_tag->content;
if (tmp[0] == '.') {
buffer = cstring_append_chars(buffer, (char*)"\\fN");
}
buffer = cstring_append_chars(buffer, (char*)sub_tag->content);
}
if (strcmp((char*)sub_tag->name, "ref") == 0) {
Expand Down

0 comments on commit 9bd9945

Please sign in to comment.