]> git.cameronkatri.com Git - mandoc.git/blobdiff - roff.c
Skipping all escape sequences at the beginning of strings in deroff()
[mandoc.git] / roff.c
diff --git a/roff.c b/roff.c
index 6b736bec6d056cc94b60b1a2776570e5d3861b49..966ed9d53dd91099bb01325c46e99fc0b5c62ffc 100644 (file)
--- a/roff.c
+++ b/roff.c
@@ -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 <kristaps@bsd.lv>
  * Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -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) {
-                       cp++;
-                       mandoc_escape((const char **)&cp, NULL, NULL);
-               } else if (isspace((unsigned char)*cp))
+       for (cp = n->string; *cp != '\0'; cp++) {
+               if (cp[0] == '\\' && strchr(" %&0^|~", cp[1]) != NULL)
                        cp++;
-               else
+               else if ( ! isspace((unsigned char)*cp))
                        break;
        }