[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [comp.lang.awk] gawk 3.1.3 [\x80-\xff] doesn't work
From: |
Aharon Robbins |
Subject: |
Re: [comp.lang.awk] gawk 3.1.3 [\x80-\xff] doesn't work |
Date: |
Sun, 10 Aug 2003 16:58:32 -0400 |
Greetings. Re this:
> To: address@hidden
> Subject: [comp.lang.awk] gawk 3.1.3 [\x80-\xff] doesn't work
> From: Aleksey Cheusov <address@hidden>
> Date: 10 Aug 2003 18:04:31 +0300
>
> Does anybody know why the following doesn't work with gawk-3.1.3
>
> LC_ALL=C
> export LC_ALL
> awk '/^[\200-\377]+$/'
>
>
> Older versions of gawk and mawk work fine.
>
> --
> Best regards, Aleksey Cheusov.
This is a bug. Below is a fix. Thanks for the test case.
Arnold
--------------------
--- ../gawk-3.1.3/regcomp.c 2003-03-11 04:42:51.000000000 -0500
+++ regcomp.c 2003-08-10 16:54:25.000000000 -0400
@@ -2407,8 +2407,8 @@
? __btowc (start_ch) : start_elem->opr.wch);
end_wc = ((end_elem->type == SB_CHAR || end_elem->type == COLL_SYM)
? __btowc (end_ch) : end_elem->opr.wch);
- cmp_buf[0] = start_wc;
- cmp_buf[4] = end_wc;
+ cmp_buf[0] = start_wc != WEOF ? start_wc : start_ch;
+ cmp_buf[4] = end_wc != WEOF ? end_wc : end_ch;
if (wcscoll (cmp_buf, cmp_buf + 4) > 0)
return REG_ERANGE;