bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [[:ascii:]] doesn't work


From: Aharon Robbins
Subject: Re: [[:ascii:]] doesn't work
Date: Mon, 11 Aug 2003 11:31:59 -0400

Greetings. Re this:

> To: Aharon Robbins <address@hidden>
> Subject: Re: [[:ascii:]] doesn't work
> From: Aleksey Cheusov <address@hidden>
> Date: 11 Aug 2003 15:28:57 +0300
>
> Aharon Robbins <address@hidden> writes:
>
> > Greetings. Re this:
> > 
> > > To: address@hidden
> > > Subject: [[:ascii:]] doesn't work
> > > From: Aleksey Cheusov <address@hidden>
> > > Date: 10 Aug 2003 18:07:00 +0300
> > >
> > > It seems to me that gawk 3.1.[0-3] is broken.
> > >
> > > 0 0,cheusov>echo -e 'hello' | mawk '/^[[:ascii:]]+$/'
> > > *0 0,cheusov>echo -e 'hello' | gawk '/^[[:ascii:]]+$/`'
> > > gawk: cmd. line:1: fatal: Invalid character class name: /^[[:ascii:]]+$/
> > > 0 2,cheusov>gawk --version
> > > GNU Awk 3.1.0
> > > ...
> > > 0,cheusov>
> > 
> > Gawk is correct: [:ascii:] isn't a valid character class name.
>
> I'm sorry, I send you a test of gawk-3.1.0 which is ok.
> The following is a result of gawk-3.1.3:
>
>  0,cheusov>echo -e 'hello' | gawk '/^[[:ascii:]]+$/'
>  gawk: cmd. line:1: fatal: Memory exhausted: /^[[:ascii:]]+$/
>  0 2,cheusov>
>
> If [:ascii:] character class in not supported,
> regular expression above is incorrect and
> a correct error message should be produced by gawk.

This error is due to the new regex library, which tends to use "no space"
as a generic error.  The following patch fixes the problem.

Thanks,

Arnold
---------------------------------------
*** ../gawk-3.1.3/regcomp.c     Tue Mar 11 04:42:51 2003
--- regcomp.c   Mon Aug 11 11:24:56 2003
***************
*** 2965,2971 ****
  #endif /* RE_ENABLE_I18N */
                                      start_elem.opr.name, syntax);
                if (BE (ret != REG_NOERROR, 0))
!                goto parse_bracket_exp_espace;
              break;
            default:
              assert (0);
--- 2965,2974 ----
  #endif /* RE_ENABLE_I18N */
                                      start_elem.opr.name, syntax);
                if (BE (ret != REG_NOERROR, 0))
!              {
!                *err = ret;
!                goto parse_bracket_exp_free_return;
!              }
              break;
            default:
              assert (0);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]