From a0d2a96024607f0e077c2cbbc08f028d9c7af5be Mon Sep 17 00:00:00 2001 From: david parsons Date: Mon, 30 May 2022 13:32:29 -0700 Subject: [PATCH] when checking character classes move the utf-8 check in front of all of the other checks; some versions of MSC have a debug mode so if a character isn't either 7-bit ascii or EOF the character class check functions will abort the program. Like, um, yeah, way to creep those standards, people! --- mkdio.c | 2 +- xml.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mkdio.c b/mkdio.c index 43d6046..7d30f5b 100644 --- a/mkdio.c +++ b/mkdio.c @@ -123,7 +123,7 @@ populate(getc_func getc, void* ctx, mkd_flag_t *flags) __mkd_enqueue(a, &line); S(line) = 0; } - else if ( isprint(c) || isspace(c) || (c & 0x80) ) + else if ( (c & 0x80) || isprint(c) || isspace(c) ) EXPAND(line) = c; } diff --git a/xml.c b/xml.c index f71b05c..20f91df 100644 --- a/xml.c +++ b/xml.c @@ -28,7 +28,7 @@ mkd_xmlchar(unsigned char c) case '&': return "&"; case '"': return """; case '\'': return "'"; - default: if ( isascii(c) || (c & 0x80) ) + default: if ( (c & 0x80) || isascii(c) ) return 0; return ""; }