summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-04-22 21:42:09 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-04-22 21:42:09 +0000
commit793b146da12a082a33d45f1ebd7aaa099711e14d (patch)
treeb35993d0f81109337013577c2b39cbcb3c1c2096 /usr.bin
parent2ad419464eb6f278b87b109a71a638a1ead2d176 (diff)
Fix a segfault reported by nicm@, introduced in rev. 1.38.
When finding a blank line, trying to parse it is a bad idea. Instead, after adding .Pp to the AST, just return from parsetext().
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mandoc/mdoc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index dac9a3512ad..5b74b17927b 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.40 2010/04/07 23:15:05 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.41 2010/04/22 21:42:08 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -655,8 +655,7 @@ parsetext(struct mdoc *m, int line, char *buf)
* allowed, but enough manuals assume this behaviour
* that we want to work around it.
*/
- if ( ! mdoc_elem_alloc(m, line, 0, MDOC_Pp, NULL))
- return(0);
+ return(mdoc_elem_alloc(m, line, 0, MDOC_Pp, NULL));
}
/*