VirtualBox

source: kBuild/vendor/grep/3.7/tests/repetition-overflow

Last change on this file was 3529, checked in by bird, 3 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
5xp1=4294967297 # 2^32+1
6xp2=4294967298 # 2^32+2
7
8fail=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
14echo abc | returns_ 2 grep -E "b{$xp1}" > out 2> /dev/null || fail=1
15compare /dev/null out || fail=1
16echo abbc | returns_ 2 grep -E "b{1,$xp2}" > out 2> /dev/null || fail=1
17compare /dev/null out || fail=1
18
19Exit $fail
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette