=================================================================== RCS file: /cvs/pod2mdoc/pod2mdoc.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -p -r1.15 -r1.16 --- pod2mdoc/pod2mdoc.c 2014/04/02 14:50:09 1.15 +++ pod2mdoc/pod2mdoc.c 2014/04/02 16:41:02 1.16 @@ -1,4 +1,4 @@ -/* $Id: pod2mdoc.c,v 1.15 2014/04/02 14:50:09 kristaps Exp $ */ +/* $Id: pod2mdoc.c,v 1.16 2014/04/02 16:41:02 kristaps Exp $ */ /* * Copyright (c) 2014 Kristaps Dzonsons * @@ -955,8 +955,19 @@ ordinary(struct state *st, const char *buf, size_t sta * following that, a newline. * Consume all whitespace so we don't * accidentally start an implicit literal line. + * If the macro ends with a flush comma or + * period, let mdoc(7) handle it for us. */ if (formatcode(st, buf, &start, end, 0, 0, seq)) { + if ((start == end - 1 || + (start < end - 1 && + (' ' == buf[start + 1] || + '\n' == buf[start + 1]))) && + ('.' == buf[start] || + ',' == buf[start])) { + putchar(' '); + putchar(buf[start++]); + } putchar(last = '\n'); while (start < end && ' ' == buf[start]) start++;