* mandoc: In man(7) and cat pages, cut off excessive one line
@ 2018-02-07 20:32 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2018-02-07 20:32 UTC (permalink / raw)
To: source
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-02-07 20:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-07 20:32 mandoc: In man(7) and cat pages, cut off excessive one line schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).