Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F101311737
D17454.id48847.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D17454.id48847.diff
View Options
Index: contrib/mandoc/main.c
===================================================================
--- contrib/mandoc/main.c
+++ contrib/mandoc/main.c
@@ -248,7 +248,13 @@
outmode = OUTMODE_ALL;
break;
case 'M':
+#ifdef __FreeBSD__
+ defpaths = strdup(optarg);
+ if (defpaths == NULL)
+ err(1, "strdup");
+#else
defpaths = optarg;
+#endif
break;
case 'm':
auxpaths = optarg;
@@ -380,9 +386,34 @@
outmode == OUTMODE_ONE)
search.firstmatch = 1;
+#ifdef __FreeBSD__
+ /*
+ * Use manpath(1) to populate defpaths if -M is not specified.
+ * Don't treat any failures as fatal.
+ */
+ if (defpaths == NULL) {
+ FILE *fp;
+ size_t linecap = 0;
+ ssize_t linelen;
+
+ if ((fp = popen("/usr/bin/manpath -q", "r")) != NULL) {
+ if ((linelen = getline(&defpaths,
+ &linecap, fp)) > 0) {
+ /* Strip trailing newline */
+ defpaths[linelen - 1] = '\0';
+ }
+ pclose(fp);
+ }
+ }
+#endif
+
/* Access the mandoc database. */
manconf_parse(&conf, conf_file, defpaths, auxpaths);
+#ifdef __FreeBSD__
+ free(defpaths);
+#endif
+
if ( ! mansearch(&search, &conf.manpath,
argc, argv, &res, &sz))
usage(search.argmode);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 28, 3:22 PM (22 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14369026
Default Alt Text
D17454.id48847.diff (1 KB)
Attached To
Mode
D17454: PR227922: man -k/-f does not search man pages/mandoc.db from packages/ports (MANPATH problem)
Attached
Detach File
Event Timeline
Log In to Comment