-/* $Id: libmdocml.c,v 1.9 2008/11/24 14:24:55 kristaps Exp $ */
+/* $Id: libmdocml.c,v 1.10 2008/11/25 12:51:17 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
* PERFORMANCE OF THIS SOFTWARE.
*/
#include <assert.h>
+#include <ctype.h>
#include <fcntl.h>
#include <err.h>
#include <stdio.h>
return(md_run_leave(args, mbuf, rbuf, 0, p));
for (i = 0; i < sz; i++) {
+ if ( ! isascii(rbuf->buf[i])) {
+ warnx("%s: non-ascii char (line %zu, col %zu)",
+ rbuf->name, rbuf->line, pos);
+ return(md_run_leave(args, mbuf, rbuf, -1, p));
+ }
if ('\n' != rbuf->buf[i]) {
if (pos < BUFFER_LINE) {
/* LINTED */