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!

This commit is contained in:
david parsons
2022-05-30 13:32:29 -07:00
parent 30ac4a5b1c
commit a0d2a96024
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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 "";
}