aboutsummaryrefslogtreecommitdiffstats
path: root/regex
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2020-10-01 04:25:54 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2020-10-01 04:25:54 +0000
commitb4ed613595432ece6802d09bfabad18e09aa26f3 (patch)
treebd2db6b09b756624c1b2babdd12ea05a9dffcdaf /regex
parent7cef6c685d23e4dcdf3f64b0b2ea92151e652db6 (diff)
downloadsrc-b4ed613595432ece6802d09bfabad18e09aa26f3.tar.gz
src-b4ed613595432ece6802d09bfabad18e09aa26f3.zip
Import nvi 2.2.0-05ed8b9vendor/nvi/2.2.0-05ed8b9vendor/nvi
This snapshot just brings a bunch of fixes in particular a fix for vi -w PR: 241985 Reported by: fernape
Notes
Notes: svn path=/vendor/nvi/dist/; revision=366307 svn path=/vendor/nvi/2.2.0-05ed8b9/; revision=366308; tag=vendor/nvi/2.2.0-05ed8b9
Diffstat (limited to 'regex')
-rw-r--r--regex/engine.c2
-rw-r--r--regex/regexec.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/regex/engine.c b/regex/engine.c
index 069a473921c5..056be0c9786e 100644
--- a/regex/engine.c
+++ b/regex/engine.c
@@ -118,7 +118,7 @@ static char *pchar(int ch);
#ifdef REDEBUG
#define SP(t, s, c) print(m, t, s, c, stdout)
#define AT(t, p1, p2, s1, s2) at(m, t, p1, p2, s1, s2)
-#define NOTE(str) { if (m->eflags&REG_TRACE) printf("=%s\n", (str)); }
+#define NOTE(str) do { if (m->eflags&REG_TRACE) printf("=%s\n", (str)); } while(0);
#else
#define SP(t, s, c) /* nothing */
#define AT(t, p1, p2, s1, s2) /* nothing */
diff --git a/regex/regexec.c b/regex/regexec.c
index 67abd01e5c87..6fed64010f40 100644
--- a/regex/regexec.c
+++ b/regex/regexec.c
@@ -114,10 +114,10 @@ static char sccsid[] = "@(#)regexec.c 8.2 (Berkeley) 3/16/94";
#define ASSIGN(d, s) memcpy(d, s, m->g->nstates)
#define EQ(a, b) (memcmp(a, b, m->g->nstates) == 0)
#define STATEVARS int vn; char *space
-#define STATESETUP(m, nv) { (m)->space = malloc((nv)*(m)->g->nstates); \
+#define STATESETUP(m, nv) do { (m)->space = malloc((nv)*(m)->g->nstates); \
if ((m)->space == NULL) return(REG_ESPACE); \
- (m)->vn = 0; }
-#define STATETEARDOWN(m) { free((m)->space); }
+ (m)->vn = 0; } while (0)
+#define STATETEARDOWN(m) free((m)->space)
#define SETUP(v) ((v) = &m->space[m->vn++ * m->g->nstates])
#define onestate int
#define INIT(o, n) ((o) = (n))