fix the reported "bug in awk" where long regexps are not evaluated correctly. the same problem exists in both native and ape versions of regexp, character classes are restricted in size - perhaps unrealisticly to 64 characters (Runes/wchar_ts). In these days of Gbytes I went to the opposite extreme and allowed 256 characters. test with awk (for ape) using: echo hello | 8.out '/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*/ { print "hit" }' for native I used this: #include #include #include extern void dump(Reprog *); void main(int argc, char *argv[]) { Reprog *re1, *re2; re1 = regcomp("[abcdefghijklmnopqrstuvwxyz]*"); re2 = regcomp("[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*"); if(regexec(re1, "hello", 0, 0)) print("match short expression\n"); if(regexec(re2, "hello", 0, 0)) print("match long expression\n"); } -Steve Notes: Thu Jan 21 19:00:26 EST 2010 geoff this will be fixed, but possibly with a dynamic allocation. Thu Jan 21 19:00:54 EST 2010 geoff Reference: /n/sources/patch/sorry/long-regexps Date: Mon Oct 26 17:08:08 CET 2009 Signed-off-by: steve@quintile.net Reviewed-by: geoff --- /sys/include/ape/regexp.h Mon Oct 26 17:03:27 2009 +++ /sys/include/ape/regexp.h Mon Oct 26 17:03:25 2009 @@ -37,7 +37,7 @@ */ struct Reclass{ wchar_t *end; - wchar_t spans[64]; + wchar_t spans[256]; }; /* --- /sys/include/regexp.h Mon Oct 26 17:03:31 2009 +++ /sys/include/regexp.h Mon Oct 26 17:03:29 2009 @@ -27,7 +27,7 @@ */ struct Reclass{ Rune *end; - Rune spans[64]; + Rune spans[256]; }; /*