| Last change
 on this file since 3561 was             3529, checked in by bird, 4 years ago | 
        
          | 
Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.
 | 
        
          | 
              
Property                 svn:executable
 set to                 * | 
        
          | File size:
            618 bytes | 
      
      
| Line |  | 
|---|
| 1 | #!/bin/sh | 
|---|
| 2 | # These would fail (i.e., match erroneously) prior to grep-2.11. | 
|---|
| 3 | . "${srcdir=.}/init.sh"; path_prepend_ ../src | 
|---|
| 4 |  | 
|---|
| 5 | xp1=4294967297 # 2^32+1 | 
|---|
| 6 | xp2=4294967298 # 2^32+2 | 
|---|
| 7 |  | 
|---|
| 8 | fail=0 | 
|---|
| 9 |  | 
|---|
| 10 | # Before grep-2.11, when DFA-matching, a repetition count exceeding the | 
|---|
| 11 | # range of "unsigned int" would silently wrap around.   Hence, 2^32+1 | 
|---|
| 12 | # would be treated just like "1", and both of these would mistakenly match. | 
|---|
| 13 |  | 
|---|
| 14 | echo abc  | returns_ 2 grep -E "b{$xp1}"   > out 2> /dev/null || fail=1 | 
|---|
| 15 | compare /dev/null out || fail=1 | 
|---|
| 16 | echo abbc | returns_ 2 grep -E "b{1,$xp2}" > out 2> /dev/null || fail=1 | 
|---|
| 17 | compare /dev/null out || fail=1 | 
|---|
| 18 |  | 
|---|
| 19 | Exit $fail | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.