summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex/regexec.c
diff options
context:
space:
mode:
authormartijn <martijn@openbsd.org>2018-07-11 12:38:46 +0000
committermartijn <martijn@openbsd.org>2018-07-11 12:38:46 +0000
commitd1a1db7f71b400e6ae6b5a9641ad1496d1d76168 (patch)
treed666730155fb2b9d0cef6e7a250db9060d1a6096 /lib/libc/regex/regexec.c
parentWhen in incremental search handle ^M (a.k.a. <cr>) like ^[ (a.k.a. (diff)
downloadwireguard-openbsd-d1a1db7f71b400e6ae6b5a9641ad1496d1d76168.tar.xz
wireguard-openbsd-d1a1db7f71b400e6ae6b5a9641ad1496d1d76168.zip
Drop a const-bomb on regexec. It's probably not a good idea to remove a
const promise when processing it in the regex engine. Minor tweak and OK schwarze@
Diffstat (limited to 'lib/libc/regex/regexec.c')
-rw-r--r--lib/libc/regex/regexec.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libc/regex/regexec.c b/lib/libc/regex/regexec.c
index ed6a4b8d62b..c59aef582be 100644
--- a/lib/libc/regex/regexec.c
+++ b/lib/libc/regex/regexec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: regexec.c,v 1.13 2014/10/11 04:23:12 doug Exp $ */
+/* $OpenBSD: regexec.c,v 1.14 2018/07/11 12:38:46 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
* Copyright (c) 1992, 1993, 1994
@@ -141,7 +141,6 @@ regexec(const regex_t *preg, const char *string, size_t nmatch,
regmatch_t pmatch[], int eflags)
{
struct re_guts *g = preg->re_g;
- char *s = (char *)string; /* XXX fucking gcc XXX */
#ifdef REDEBUG
# define GOODFLAGS(f) (f)
@@ -157,7 +156,7 @@ regexec(const regex_t *preg, const char *string, size_t nmatch,
eflags = GOODFLAGS(eflags);
if (g->nstates <= CHAR_BIT*sizeof(states1) && !(eflags&REG_LARGE))
- return(smatcher(g, s, nmatch, pmatch, eflags));
+ return(smatcher(g, string, nmatch, pmatch, eflags));
else
- return(lmatcher(g, s, nmatch, pmatch, eflags));
+ return(lmatcher(g, string, nmatch, pmatch, eflags));
}