help / color / mirror / Atom feed
From: Yuri Pankov <yuripv@yuripv.net>
To: mandoc-discuss <discuss@mandoc.bsd.lv>
Cc: Baptiste Daroussin <bapt@FreeBSD.org>
Subject: use regex search by default in FreeBSD
Date: Sat, 17 Nov 2018 16:07:33 +0300	[thread overview]
Message-ID: <6bc32bc8-d66e-7a55-53e6-f4fcb423e1e8@yuripv.net> (raw)

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


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?


[-- 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];
 		e->match.type = DBM_SUB;
 		e->match.str = argv[*argi];
 	} else {
 		if (val == argv[*argi])

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

                 reply	other threads:[~2018-11-17 13:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6bc32bc8-d66e-7a55-53e6-f4fcb423e1e8@yuripv.net \
    --to=yuripv@yuripv.net \
    --cc=bapt@FreeBSD.org \
    --cc=discuss@mandoc.bsd.lv \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).