diff options
Diffstat (limited to 'regex.c')
-rw-r--r-- | regex.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -502,6 +502,16 @@ re_compile_pattern (pattern, size, bufp) while (1) { PATFETCH (c); + + /* If awk, \ escapes a ] when inside [...]. */ + if ((obscure_syntax & RE_AWK_CLASS_HACK) + && c == '\\' && *p == ']') + { + PATFETCH(c1); + b[c1 / BYTEWIDTH] |= 1 << (c1 % BYTEWIDTH); + continue; + } + if (c == ']' && p != p1 + 1) break; if (*p == '-' && p[1] != ']') { |