=================================================================== RCS file: /cvs/mandoc/roff.c,v retrieving revision 1.287 retrieving revision 1.288 diff -u -p -r1.287 -r1.288 --- mandoc/roff.c 2017/01/10 21:59:47 1.287 +++ mandoc/roff.c 2017/01/12 18:02:20 1.288 @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.287 2017/01/10 21:59:47 schwarze Exp $ */ +/* $Id: roff.c,v 1.288 2017/01/12 18:02:20 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017 Ingo Schwarze @@ -1223,16 +1223,12 @@ deroff(char **dest, const struct roff_node *n) return; } - /* Skip leading whitespace and escape sequences. */ + /* Skip leading whitespace. */ - cp = n->string; - while (*cp != '\0') { - if ('\\' == *cp) { + for (cp = n->string; *cp != '\0'; cp++) { + if (cp[0] == '\\' && strchr(" %&0^|~", cp[1]) != NULL) cp++; - mandoc_escape((const char **)&cp, NULL, NULL); - } else if (isspace((unsigned char)*cp)) - cp++; - else + else if ( ! isspace((unsigned char)*cp)) break; }