cmark

Unnamed repository; edit this file 'description' to name the repository.

commit acd11e2766a10236750424453059abb2ab759d1e
parent 5fcc575ee3a77da65cb63cd43eb4235c851ce6ad
Author: John MacFarlane <jgm@berkeley.edu>
Date:   Sun, 29 Mar 2015 20:55:43 -0700

Fixed bug in cmark_strbuf_unescape (buffer.c).

The old function called 'continue' when seeing a backslash,
but this gave incorrect results on input like:

    \\*

since the next backslash would be treated as escaping the `*`
instead of being escaped itself.

Diffstat:
Msrc/buffer.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/buffer.c b/src/buffer.c
@@ -372,7 +372,7 @@ extern void cmark_strbuf_unescape(cmark_strbuf *buf)
 
 	for (r = 0, w = 0; r < buf->size; ++r) {
 		if (buf->ptr[r] == '\\' && cmark_ispunct(buf->ptr[r + 1]))
-			continue;
+			r++;
 
 		buf->ptr[w++] = buf->ptr[r];
 	}