The following diff constifies the strings in cnames[]. No functional
change.
Index: cname.h
===================================================================
RCS file: /OpenBSD/src/lib/libc/regex/cname.h,v
retrieving revision 1.5
diff -u -p -r1.5 cname.h
--- cname.h 2 Jun 2003 20:18:36 -0000 1.5
+++ cname.h 29 Dec 2020 09:30:53 -0000
@@ -36,8 +36,8 @@
*/
/* character-name table */
-static struct cname {
- char *name;
+static const struct cname {
+ const char *name;
char code;
} cnames[] = {
{ "NUL", '\0' },
Index: regcomp.c
===================================================================
RCS file: /OpenBSD/src/lib/libc/regex/regcomp.c,v
retrieving revision 1.35
diff -u -p -r1.35 regcomp.c
--- regcomp.c 13 Oct 2020 04:42:28 -0000 1.35
+++ regcomp.c 29 Dec 2020 09:30:53 -0000
@@ -826,7 +815,7 @@ p_b_coll_elem(struct parse *p,
int endc) /* name ended by endc,']' */
{
char *sp = p->next;
- struct cname *cp;
+ const struct cname *cp;
size_t len;
while (MORE() && !SEETWO(endc, ']'))