From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 2e6f767e for ; Wed, 7 Feb 2018 15:32:10 -0500 (EST) Date: Wed, 7 Feb 2018 15:32:10 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: In man(7) and cat pages, cut off excessive one line X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-Id: <84f49445e1e1b86f@fantadrom.bsd.lv> Log Message: ----------- In man(7) and cat pages, cut off excessive one line descriptions. An extreme example of how rogue files could mess up apropos(1) output was reported by bentley@: qwtlicense(3) in the x11/qwt port. Modified Files: -------------- mandoc: mandocdb.c Revision Data ------------- Index: mandocdb.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/mandocdb.c,v retrieving revision 1.256 retrieving revision 1.257 diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.256 -r1.257 --- mandocdb.c +++ mandocdb.c @@ -1373,7 +1373,12 @@ parse_cat(struct mpage *mpage, int fd) plen -= 2; } - mpage->desc = mandoc_strdup(p); + /* + * Cut off excessive one-line descriptions. + * Bad pages are not worth better heuristics. + */ + + mpage->desc = mandoc_strndup(p, 150); fclose(stream); free(title); } @@ -1517,7 +1522,12 @@ parse_man(struct mpage *mpage, const str while (' ' == *start) start++; - mpage->desc = mandoc_strdup(start); + /* + * Cut off excessive one-line descriptions. + * Bad pages are not worth better heuristics. + */ + + mpage->desc = mandoc_strndup(start, 150); free(title); return; } -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv