=================================================================== RCS file: /cvs/docbook2mdoc/macro.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -p -r1.9 -r1.10 --- docbook2mdoc/macro.c 2019/04/11 04:23:22 1.9 +++ docbook2mdoc/macro.c 2019/04/12 08:48:16 1.10 @@ -1,4 +1,4 @@ -/* $Id: macro.c,v 1.9 2019/04/11 04:23:22 schwarze Exp $ */ +/* $Id: macro.c,v 1.10 2019/04/12 08:48:16 schwarze Exp $ */ /* * Copyright (c) 2019 Ingo Schwarze * @@ -212,9 +212,12 @@ macro_nodeline(struct format *f, const char *name, str * line otherwise. The flag ARG_SPACE inserts spaces between words. */ void -print_text(struct format *f, const char *word, int flags) { +print_text(struct format *f, const char *word, int flags) +{ switch (f->linestate) { case LINE_NEW: + if (*word == '.' || *word == '\'') + fputs("\\&", stdout); break; case LINE_TEXT: if (flags & ARG_SPACE) @@ -224,7 +227,11 @@ print_text(struct format *f, const char *word, int fla macro_close(f); break; } - fputs(word, stdout); + while (*word != '\0') { + putchar(*word); + if (*word++ == '\\') + putchar('e'); + } f->linestate = LINE_TEXT; f->flags = 0; }