From: Ben Gras Date: Mon, 24 Jun 2013 14:41:30 +0000 (+0000) Subject: re-import makewhatis X-Git-Tag: v3.3.0~903 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=910825ee9be037a035622b9aad43731a14af3284;p=minix.git re-import makewhatis . to benefit from the contribution found by rjkovacic@gmail.com in the minix makewhatis and submitted upstream, see NetBSD PR/47958 Change-Id: I147e1afe0088ab16e7b171f74330d1c6f44a13cf --- diff --git a/libexec/makewhatis/makewhatis.c b/libexec/makewhatis/makewhatis.c index acaadcb60..3ba2ace5e 100644 --- a/libexec/makewhatis/makewhatis.c +++ b/libexec/makewhatis/makewhatis.c @@ -1,4 +1,4 @@ -/* $NetBSD: makewhatis.c,v 1.47 2009/04/02 21:39:33 apb Exp $ */ +/* $NetBSD: makewhatis.c,v 1.48 2013/06/24 12:56:22 christos Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #if !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1999\ The NetBSD Foundation, Inc. All rights reserved."); -__RCSID("$NetBSD: makewhatis.c,v 1.47 2009/04/02 21:39:33 apb Exp $"); +__RCSID("$NetBSD: makewhatis.c,v 1.48 2013/06/24 12:56:22 christos Exp $"); #endif /* not lint */ #include @@ -107,7 +107,10 @@ static void dumpwhatis(FILE *, whatis *); static int makewhatis(char * const *manpath); static char * const default_manpath[] = { +#ifdef __minix "/usr/man", +#endif + "/usr/share/man", NULL }; @@ -871,6 +874,8 @@ static char * parsemanpage(const char *name, gzFile *in, int defaultsection) { char *section, buffer[8192], *ptr; + static const char POD[] = ".\\\" Automatically generated by Pod"; + static const char IX[] = ".IX TITLE"; section = NULL; do { @@ -878,6 +883,24 @@ parsemanpage(const char *name, gzFile *in, int defaultsection) free(section); return NULL; } + + /* + * Skip over lines in man pages that have been generated + * by Pod, until we find the TITLE. This makewhatis cannot + * deal with it (and as * a result the man page would not + * appear in whatis.db) + * Modified by Robert Kovacic, June 23 2013. + */ + if (strncasecmp(buffer, POD, sizeof(POD) - 1) == 0) { + do { + if (GetS(in, buffer, sizeof(buffer) - 1) + == NULL) { + free(section); + return NULL; + } + } while (strncasecmp(buffer, IX, sizeof(IX) - 1) != 0); + } + if (manpreprocess(buffer)) continue; if (strncasecmp(buffer, ".Dt", 3) == 0) { diff --git a/releasetools/nbsd_ports b/releasetools/nbsd_ports index 2f7e1d719..d24ac3c79 100644 --- a/releasetools/nbsd_ports +++ b/releasetools/nbsd_ports @@ -64,7 +64,7 @@ 2012/10/17 12:00:00,libexec/ld.elf_so 2012/10/17 12:00:00,libexec/Makefile 2012/10/17 12:00:00,libexec/Makefile.inc -2009/04/02 21:39:33,libexec/makewhatis +2013/06/24 14:00:00,libexec/makewhatis 2012/10/17 12:00:00,lib/csu 2012/10/17 12:00:00,lib/libbz2 2012/10/17 12:00:00,lib/libc