=================================================================== RCS file: /cvs/pod2mdoc/pod2mdoc.c,v retrieving revision 1.49 retrieving revision 1.52 diff -u -p -r1.49 -r1.52 --- pod2mdoc/pod2mdoc.c 2015/02/19 10:59:35 1.49 +++ pod2mdoc/pod2mdoc.c 2015/02/19 11:14:27 1.52 @@ -1,4 +1,4 @@ -/* $Id: pod2mdoc.c,v 1.49 2015/02/19 10:59:35 schwarze Exp $ */ +/* $Id: pod2mdoc.c,v 1.52 2015/02/19 11:14:27 schwarze Exp $ */ /* * Copyright (c) 2014 Kristaps Dzonsons * Copyright (c) 2014, 2015 Ingo Schwarze @@ -1200,7 +1200,10 @@ again: if ('\0' != *cp2) dict_put(cp2, 0, MDOC_Fa); register_type(buf + ifa); - printf(".Fa \"%s\"\n", buf + ifa); + if (strchr(buf + ifa, ' ') == NULL) + printf(".Fa %s\n", buf + ifa); + else + printf(".Fa \"%s\"\n", buf + ifa); if (cp == NULL) break; while (*cp == ' ' || *cp == '\t') @@ -1425,6 +1428,7 @@ ordinary(struct state *st, const char *buf, size_t sta if ( ! isspace(last)) outbuf_addchar(st); if (start < end && + ! isspace((unsigned char)buf[start - 1]) && ! isspace((unsigned char)buf[start])) continue; @@ -1529,12 +1533,11 @@ ordinary(struct state *st, const char *buf, size_t sta * XXX Some punctuation characters * are not handled yet. */ - if ((start == end - 1 || - (start < end - 1 && - (' ' == buf[start + 1] || - '\n' == buf[start + 1]))) && - ('.' == buf[start] || - ',' == buf[start])) { + if ((start == end - 1 || + (start < end - 1 && + (' ' == buf[start + 1] || + '\n' == buf[start + 1]))) && + NULL != strchr("|.,;:?!)]", buf[start])) { putchar(' '); putchar(buf[start++]); }