bug-gnulib
[Top][All Lists]
Advanced

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

Gnulib's regex.c appears to ignore RE_ICASE


From: James Youngman
Subject: Gnulib's regex.c appears to ignore RE_ICASE
Date: Sun, 3 Jul 2005 15:33:57 +0100
User-agent: Mutt/1.5.9i

Hello all, 

I've just noticed that Gnulib's regex.c implementation appears to
ignore the RE_ICASE flag.  The regexec() function it provides takes
notice of REG_ICASE (and sets up a translation table), but the
re_compile_pattern() and re_search() family ignore the RE_ICASE flag
(and of course they also ignore REG_ICASE, as they should I suppose).

The RE_ICASE flag appears to work with glibc's implementation of
re_match().  My system is using libc6 from Debian (2.3.2.ds1-22).

$ cvs -z3 update regex.[ch]
$ grep _ICASE *.[ch]
regex.c:     If REG_ICASE is set, then we considers upper- and lowercase
regex.c:  if (cflags & REG_ICASE)
regex.h:#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
regex.h:#define REG_ICASE (REG_EXTENDED << 1)
regex.h:#define REG_NEWLINE (REG_ICASE << 1)
$ cat CVS/Root
:ext:address@hidden:/cvsroot/gnulib
$ cvs -z3 status regex.[ch]
===================================================================
File: regex.c           Status: Up-to-date

   Working revision:    1.89
   Repository revision: 1.89    /cvsroot/gnulib/gnulib/lib/regex.c,v
   Sticky Tag:          (none)
   Sticky Date:         (none)
   Sticky Options:      (none)

===================================================================
File: regex.h           Status: Up-to-date

   Working revision:    1.24
   Repository revision: 1.24    /cvsroot/gnulib/gnulib/lib/regex.h,v
   Sticky Tag:          (none)
   Sticky Date:         (none)
   Sticky Options:      (none)

It looks to me as if I could set up the "translate" member of struct
re_pattern_buffer, but I assume that that would not cope correctly
non-English locales with UTF-8 or UTF-16 character mappings (since
characters above 0xFF would be passed through).

If RE_ICASE is intended not to be supported, can we remove that macro
definition from regex.h please?  That way, code which relies on the
functionality can then fail to compile as opposed to compiling but not
working.

Regards,
James.




reply via email to

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