summaryrefslogtreecommitdiff
path: root/regress/lib/libc
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2020-12-31 17:20:20 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2020-12-31 17:20:20 +0000
commit9b5ad9922b2797a6c52fe9f71a1e237fdd679abe (patch)
tree074835cb740986b0cb66821c2b6ed5f886039dd1 /regress/lib/libc
parent8185ec2838d1119cf98689c7d2e6657bc6ff6c17 (diff)
Remove unused categories in re_guts; they are written to but never read.
From miod@, OK tb@
Diffstat (limited to 'regress/lib/libc')
-rw-r--r--regress/lib/libc/regex/debug.c41
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");
- }
}
/*