summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex/regex2.h
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2021-01-03 17:07:57 +0000
committertb <tb@openbsd.org>2021-01-03 17:07:57 +0000
commit6545ccd242728217b5b3be5aa62fa25321eac6dc (patch)
tree2a78917d92ffd0083368d2d4852ae4a27f120641 /lib/libc/regex/regex2.h
parentCreate .1 backup files when acme-client is going to overwrite a (diff)
downloadwireguard-openbsd-6545ccd242728217b5b3be5aa62fa25321eac6dc.tar.xz
wireguard-openbsd-6545ccd242728217b5b3be5aa62fa25321eac6dc.zip
Make CHIN() Boolean-valued and use this to turn an expression with a
quintuple negation into one with a simple negation. From miod, ok millert
Diffstat (limited to 'lib/libc/regex/regex2.h')
-rw-r--r--lib/libc/regex/regex2.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/regex/regex2.h b/lib/libc/regex/regex2.h
index 5a609f4aea8..6fb9dcca27c 100644
--- a/lib/libc/regex/regex2.h
+++ b/lib/libc/regex/regex2.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: regex2.h,v 1.11 2021/01/03 10:50:02 tb Exp $ */
+/* $OpenBSD: regex2.h,v 1.12 2021/01/03 17:07:58 tb Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
@@ -122,10 +122,10 @@ CHsub(cset *cs, char c)
cs->hash -= c;
}
-static inline uch
+static inline int
CHIN(const cset *cs, char c)
{
- return cs->ptr[(uch)c] & cs->mask;
+ return (cs->ptr[(uch)c] & cs->mask) != 0;
}
/*