From 483a58b779f2bd6c5fff64c9429a766d33e46a41 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 2 Jul 2010 15:49:42 +0300 Subject: Now at 2.03. --- regex.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'regex.c') diff --git a/regex.c b/regex.c index 40118055..618a3a9c 100644 --- a/regex.c +++ b/regex.c @@ -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] != ']') { -- cgit v1.2.3