summaryrefslogtreecommitdiff
path: root/maketables.c
diff options
context:
space:
mode:
Diffstat (limited to 'maketables.c')
-rw-r--r--maketables.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/maketables.c b/maketables.c
index 257fe89..bf88531 100644
--- a/maketables.c
+++ b/maketables.c
@@ -126,9 +126,13 @@ for (i = 0; i < 256; i++)
if (isdigit(i)) x += ctype_digit;
if (isxdigit(i)) x += ctype_xdigit;
if (isalnum(i) || i == '_') x += ctype_word;
- if (strchr("*+?{^.$|()[", i) != 0) x += ctype_meta;
- *p++ = x;
- }
+
+ /* Note: strchr includes the terminating zero in the characters it considers.
+ In this instance, that is ok because we want binary zero to be flagged as a
+ meta-character, which in this sense is any character that terminates a run
+ of data characters. */
+
+ if (strchr("*+?{^.$|()[", i) != 0) x += ctype_meta; *p++ = x; }
return yield;
}