bug-grep
[Top][All Lists]
Advanced

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

[bug-grep] Re: [bugs #12210] EGexecute() fails to find matches on (exact


From: Claudio Fontana
Subject: [bug-grep] Re: [bugs #12210] EGexecute() fails to find matches on (exact && match_icase)
Date: Sat, 5 Mar 2005 00:02:26 +0100 (CET)

Hello,

my account at savannah is underway.

> > grep.c::prline()
> 
> The prline() problem where the case-folded match
> instead of the original is
> printed is known.  I advocate getting rid of the
> whole thing in patch #3767
> as it's no longer needed anyways (unless you can
> prove otherwise).

Well, ok we both agree that those should be removed,
and I looked at patch #3767 (got the .c), and it would
work ok if not for the problem I am trying to explain
:)

Try to apply your patch, build, then type:

$ echo Claudio | ./grep -i --color claudio
Claudio

great...but where's the color?

$ Try also:
echo Claudio | ./grep -i -o claudio

[nomatch]

 - Sorry about my name being everywhere :P

This is exactly the point I am making..
your patch SHOULD work, but does not due to a problem
internal to EGexecute when called with exact=1 or one
of the called functions / related state.

I have tried to address the issue among others in a
patch I am preparing.

Note that I did exactly just like you removing the
special (match_icase) treatment, but then observing it
does not work in match_icase cases, I hit my head
against the monitor studying the thing and did NOT
come out with a solution, mainly because I still don't
get the various involved regex internals. Given enough
time, I hope to learn it all.

I looked at another person's patch (cannot remember
anymore, called something like javaed, could have been
unrelated), and noticed he assigned to
patterns[pcount].regexbuf.translate . So I supposed I
could do once and for all at the start of program a 

if (match_icase) 
  build_translation_table();

/* and then when adding a pattern */

if (match_icase) 
patterns[pcount].regexbuf.translate =
icase_trans_table;

It seems to work nicely, however I do not know if
there are issues about wide char strings (I do not
have wide char strings support compiled in, so did not
test the wchar code, and know crap about wstrings). To
build the translation table I am using TOLOWER,
however I understand this does not work for wchars?

Maybe you could help me by making it work with wc
strings too?

The patch in question is contained in this:

http://cmdftp.sourceforge.net/preview.p1.patch

You'll find some variable names changed, however you
should be able to figure out by looking at grepopt.h

Claudio



                
___________________________________ 
Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, 
Giochi, Rubrica… Scaricalo ora! 
http://it.messenger.yahoo.it




reply via email to

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