discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* use regex search by default in FreeBSD
@ 2018-11-17 13:07 Yuri Pankov
  0 siblings, 0 replies; only message in thread
From: Yuri Pankov @ 2018-11-17 13:07 UTC (permalink / raw)
  To: mandoc-discuss; +Cc: Baptiste Daroussin


[-- Attachment #1.1.1: Type: text/plain, Size: 289 bytes --]

Hi,

There's a PR filed in FreeBSD to revert the apropos search back to regex
by default for backward (and not only) compatibility.  Could you please
integrate the attached patch to reduce the number of local modifications?

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223556

[-- Attachment #1.1.2: pr223556.diff --]
[-- Type: text/plain, Size: 604 bytes --]

diff --git a/contrib/mandoc/mansearch.c b/contrib/mandoc/mansearch.c
index 784c17bee714..7fcf82928b87 100644
--- a/contrib/mandoc/mansearch.c
+++ b/contrib/mandoc/mansearch.c
@@ -774,7 +774,13 @@ exprterm(const struct mansearch *search, int argc, char *argv[], int *argi)
 		cs = 0;
 	} else if ((val = strpbrk(argv[*argi], "=~")) == NULL) {
 		e->bits = TYPE_Nm | TYPE_Nd;
+#ifdef __FreeBSD__
+		/* FreeBSD uses regex search by default */
+		e->match.type = DBM_REGEX;
+		val = argv[*argi];
+#else
 		e->match.type = DBM_SUB;
+#endif
 		e->match.str = argv[*argi];
 	} else {
 		if (val == argv[*argi])

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-17 13:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-17 13:07 use regex search by default in FreeBSD Yuri Pankov

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).