cmark

My personal build of CMark ✏️

Commit
acd11e2766a10236750424453059abb2ab759d1e
Parent
5fcc575ee3a77da65cb63cd43eb4235c851ce6ad
Author
John MacFarlane <jgm@berkeley.edu>
Date

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

1 file changed, 1 insertion, 1 deletion

Status File Name N° Changes Insertions Deletions
Modified src/buffer.c 2 1 1
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];
 	}