Module Name:    src
Committed By:   christos
Date:           Thu Nov  8 19:17:55 UTC 2012

Modified Files:
        src/usr.sbin/makemandb: makemandb.c

Log Message:
If you cannot parse .SH NAME, like in the case of the ksh93 man page
where the .SH is followed by a conditional:

.SH NAME
.if \nZ=0 \{\
text text text
.\}

at least don't core-dump.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/makemandb/makemandb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makemandb/makemandb.c
diff -u src/usr.sbin/makemandb/makemandb.c:1.15 src/usr.sbin/makemandb/makemandb.c:1.16
--- src/usr.sbin/makemandb/makemandb.c:1.15	Sat Oct  6 11:33:59 2012
+++ src/usr.sbin/makemandb/makemandb.c	Thu Nov  8 14:17:54 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: makemandb.c,v 1.15 2012/10/06 15:33:59 wiz Exp $	*/
+/*	$NetBSD: makemandb.c,v 1.16 2012/11/08 19:17:54 christos Exp $	*/
 /*
  * Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadh...@gmail.com>
  * Copyright (c) 2011 Kristaps Dzonsons <krist...@bsd.lv>
@@ -17,7 +17,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: makemandb.c,v 1.15 2012/10/06 15:33:59 wiz Exp $");
+__RCSID("$NetBSD: makemandb.c,v 1.16 2012/11/08 19:17:54 christos Exp $");
 
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -1277,6 +1277,8 @@ pman_sh(const struct man_node *n, mandb_
 		pman_parse_name(n, rec);
 
 		name_desc = rec->name_desc;
+		if (name_desc == NULL)
+			return;
 
 		/* Remove any leading spaces. */
 		while (name_desc[0] == ' ')

Reply via email to