From 72906058343b3bc6ee3b40ae612035ae597539c5 Mon Sep 17 00:00:00 2001 From: dmcmahill Date: Fri, 25 Jul 2003 12:58:20 +0000 Subject: - fix bug that gave an invalid entry in the homepage field when there is no listed homepage. Thanks to Grant Beattie for noting this and providing a patch which I changed slightly. - fix a bug which put extra stuff in the categories field. Thanks to Grant for noting this. --- mk/scripts/genindex.awk | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/mk/scripts/genindex.awk b/mk/scripts/genindex.awk index b7ae234fd25..626e253d071 100755 --- a/mk/scripts/genindex.awk +++ b/mk/scripts/genindex.awk @@ -1,5 +1,5 @@ #!/usr/bin/awk -f -# $NetBSD: genindex.awk,v 1.2 2003/07/24 22:27:17 dmcmahill Exp $ +# $NetBSD: genindex.awk,v 1.3 2003/07/25 12:58:20 dmcmahill Exp $ # # Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. # All rights reserved. @@ -124,7 +124,13 @@ BEGIN { } /^categories /{ - categories[$2] = substr($0, index($0, $3)); + # note: we pick out the categories slightly differently than the comment + # and homepage because the category name will be included in the directory + # name and hence the index() call points to the wrong location + categories[$2] = $3; + for(i = 4; i <= NF; i = i + 1) { + categories[$2] = categories[$2] " " $i; + } next; } @@ -139,7 +145,11 @@ BEGIN { } /^homepage /{ - homepage[$2] = substr($0, index($0, $3)); + if( NF>=3 ) { + homepage[$2] = substr($0, index($0, $3)); + } else { + homepage[$2] = ""; + } next; } -- cgit v1.2.3