diff options
author | 2020-12-31 17:20:19 +0000 | |
---|---|---|
committer | 2020-12-31 17:20:19 +0000 | |
commit | a2944cb5a4ff13fc12aa4ee37f0a8f9375025a65 (patch) | |
tree | 9b8d56ebcb179fa4c2865b99c02bc1466dc68fb8 /regress/lib/libc/regex/debug.c | |
parent | oops, this was installing the smaller bsd.rd, which would be replaced (diff) | |
download | wireguard-openbsd-a2944cb5a4ff13fc12aa4ee37f0a8f9375025a65.tar.xz wireguard-openbsd-a2944cb5a4ff13fc12aa4ee37f0a8f9375025a65.zip |
Remove unused categories in re_guts; they are written to but never read.
From miod@, OK tb@
Diffstat (limited to 'regress/lib/libc/regex/debug.c')
-rw-r--r-- | regress/lib/libc/regex/debug.c | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/regress/lib/libc/regex/debug.c b/regress/lib/libc/regex/debug.c index 11129e7249d..7044a2a185a 100644 --- a/regress/lib/libc/regex/debug.c +++ b/regress/lib/libc/regex/debug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: debug.c,v 1.4 2003/07/31 21:48:03 deraadt Exp $ */ +/* $OpenBSD: debug.c,v 1.5 2020/12/31 17:20:19 millert Exp $ */ /* $NetBSD: debug.c,v 1.2 1995/04/20 22:39:42 cgd Exp $ */ #include <stdio.h> @@ -26,10 +26,8 @@ FILE *d; register int i; register int c; register int last; - int nincat[NC]; - fprintf(d, "%ld states, %d categories", (long)g->nstates, - g->ncategories); + fprintf(d, "%ld states", (long)g->nstates); fprintf(d, ", first %ld last %ld", (long)g->firststate, (long)g->laststate); if (g->iflags&USEBOL) @@ -49,41 +47,6 @@ FILE *d; fprintf(d, ", nplus %ld", (long)g->nplus); fprintf(d, "\n"); s_print(g, d); - for (i = 0; i < g->ncategories; i++) { - nincat[i] = 0; - for (c = CHAR_MIN; c <= CHAR_MAX; c++) - if (g->categories[c] == i) - nincat[i]++; - } - fprintf(d, "cc0#%d", nincat[0]); - for (i = 1; i < g->ncategories; i++) - if (nincat[i] == 1) { - for (c = CHAR_MIN; c <= CHAR_MAX; c++) - if (g->categories[c] == i) - break; - fprintf(d, ", %d=%s", i, regchar(c)); - } - fprintf(d, "\n"); - for (i = 1; i < g->ncategories; i++) - if (nincat[i] != 1) { - fprintf(d, "cc%d\t", i); - last = -1; - for (c = CHAR_MIN; c <= CHAR_MAX+1; c++) /* +1 does flush */ - if (c <= CHAR_MAX && g->categories[c] == i) { - if (last < 0) { - fprintf(d, "%s", regchar(c)); - last = c; - } - } else { - if (last >= 0) { - if (last != c-1) - fprintf(d, "-%s", - regchar(c-1)); - last = -1; - } - } - fprintf(d, "\n"); - } } /* |