buggrep - Bugs: bug #9519, echo do^re | grep do^re; fails...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #9519: echo do^re | grep do^re; fails while grep -i do^re succeeds

Submitted by:  Len Lattanzi <zardoz>
Submitted on:  Thu 01 Jul 2004 05:51:05 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Mon 11 Apr 2005 10:37:59 PM UTC, comment #2:

Fixed in CVS. Thanks for the patch.

Julian Foad <julianfoad>
Mon 11 Apr 2005 10:27:11 PM UTC, comment #1:

Clarification:

With grep v2.5.1, "echo do^re | grep do^re" finds no match, which is wrong, and "echo do^re | grep -i do^re" finds "do^re", which is correct.

The correct behaviour is to find a match, since plain "grep" has context-sensitive anchors: '^' is only special at the beginning of an RE or after a special '(' or '|'.

In contrast, "egrep" has context-independent anchors, so "echo do^re | egrep do^re" and "echo do^re | egrep -i do^re" should not find a match, and indeed they don't.

Julian Foad <julianfoad>
Thu 01 Jul 2004 05:51:05 AM UTC, original submission:

===================================================================
RCS file: /cvsroot/grep/grep/src/dfa.c,v
retrieving revision 1.22
diff -u -r1.22 dfa.c
--- src/dfa.c 8 Jul 2003 14:58:05 -0000 1.22
+++ src/dfa.c 1 Jul 2004 05:46:41 -0000
@@ -1096,7 +1096,7 @@
setbit_case_fold (c, ccl);
return lasttok = CSET + charclass_index(ccl);
}
- return c;
+ return lasttok = c;
}
}

Len Lattanzi <zardoz>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 11 Apr 2005 10:37:59 PM UTCjulianfoadStatusNone=>Fixed
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1