diff options
author | 2018-07-11 12:38:46 +0000 | |
---|---|---|
committer | 2018-07-11 12:38:46 +0000 | |
commit | d1a1db7f71b400e6ae6b5a9641ad1496d1d76168 (patch) | |
tree | d666730155fb2b9d0cef6e7a250db9060d1a6096 /lib/libc/regex/regexec.c | |
parent | When in incremental search handle ^M (a.k.a. <cr>) like ^[ (a.k.a. (diff) | |
download | wireguard-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.c | 7 |
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®_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)); } |