From: Kristaps Dzonsons Date: Sun, 16 May 2010 00:04:46 +0000 (+0000) Subject: Fix allowing silly '\'' control character. X-Git-Tag: VERSION_1_10_1~120 X-Git-Url: https://git.cameronkatri.com/mandoc.git/commitdiff_plain/56769575b59463282f2527c0dccc339862efdf04 Fix allowing silly '\'' control character. --- diff --git a/main.c b/main.c index 90960915..730d4397 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.74 2010/05/15 22:28:22 kristaps Exp $ */ +/* $Id: main.c,v 1.75 2010/05/16 00:04:46 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -574,7 +574,7 @@ pset(const char *buf, int pos, struct curparse *curp, * default to -man, which is more lenient. */ - if (buf[0] == '.') { + if ('.' == buf[0] || '\'' == buf[0]) { for (i = 1; buf[i]; i++) if (' ' != buf[i] && '\t' != buf[i]) break; diff --git a/man.c b/man.c index 07b02369..a1a0ecd4 100644 --- a/man.c +++ b/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.70 2010/05/15 22:44:04 kristaps Exp $ */ +/* $Id: man.c,v 1.71 2010/05/16 00:04:46 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -151,7 +151,7 @@ int man_parseln(struct man *m, int ln, char *buf) { - return('.' == *buf || '\'' == *buf ? + return(('.' == *buf || '\'' == *buf) ? man_pmacro(m, ln, buf) : man_ptext(m, ln, buf)); } diff --git a/mdoc.c b/mdoc.c index 9ef84d58..e521e27b 100644 --- a/mdoc.c +++ b/mdoc.c @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.133 2010/05/15 16:24:37 kristaps Exp $ */ +/* $Id: mdoc.c,v 1.134 2010/05/16 00:04:46 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -291,7 +291,7 @@ mdoc_parseln(struct mdoc *m, int ln, char *buf) return(0); m->flags |= MDOC_NEWLINE; - return('.' == *buf ? + return(('.' == *buf || '\'' == *buf) ? mdoc_pmacro(m, ln, buf) : mdoc_ptext(m, ln, buf)); }