Fix a{0}, update tests.

This commit is contained in:
Arnold D. Robbins 2020-01-31 08:40:11 +02:00
parent e2d71a98a4
commit 78c79c06d0
4 changed files with 52 additions and 5 deletions

11
FIXES
View File

@ -25,6 +25,11 @@ THIS SOFTWARE.
This file lists all bug fixes, changes, etc., made since the AWK book
was sent to the printers in August, 1987.
January 31, 2020:
Merge PR #70, which avoids use of variable length arrays. Thanks
to GitHub user michaelforney. Fix issue #60 ({0} in interval
expressions doesn't work). Thanks to Arnold Robbins.
January 24, 2020:
A number of small cleanups from Christos Zoulas. Add the close
on exec flag to files/pipes opened for redirection; courtesy of
@ -77,13 +82,13 @@ October 25, 2019:
October 24, 2019:
Import second round of code cleanups from NetBSD. Much thanks
to Christos Zoulas (Github user zoulasc). Merges PR 53.
to Christos Zoulas (GitHub user zoulasc). Merges PR 53.
Add an optimization for string concatenation, also from
Christos.
October 17, 2019:
Import code cleanups from NetBSD. Much thanks to Christos
Zoulas (Github user zoulasc). Merges PR 51.
Zoulas (GitHub user zoulasc). Merges PR 51.
October 6, 2019:
Import code from NetBSD awk that implements RS as a regular
@ -91,7 +96,7 @@ October 6, 2019:
September 10, 2019:
Fixes for various array / memory overruns found via gcc's
-fsanitize=unknown. Thanks to Alexander Richardson (Github
-fsanitize=unknown. Thanks to Alexander Richardson (GitHub
user arichardson). Merges PRs 47 and 48.
July 28, 2019:

2
main.c
View File

@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
const char *version = "version 20200124";
const char *version = "version 20200131";
#define DEBUG
#include <stdio.h>

View File

@ -18,6 +18,34 @@ pat ab{0}c
ac 1
abc 0
pat a(b{0})c
ac 1
abc 0
pat ab{0}*c
ac 1
abc 0
pat a(b{0})*c
ac 1
abc 0
pat ab{0,}c
ac 1
abc 1
pat a(b{0,})c
ac 1
abc 1
pat ab{0,}*c
ac 1
abc 1
pat a(b{0,})*c
ac 1
abc 1
pat ab{1}c
ac 0
abc 1
@ -53,6 +81,20 @@ EOF
cat << \EOF > foo1
ac ~ /ab{0}c/ -> should be 1, is 1
abc ~ /ab{0}c/ -> should be 0, is 0
ac ~ /a(b{0})c/ -> should be 1, is 1
abc ~ /a(b{0})c/ -> should be 0, is 0
ac ~ /ab{0}*c/ -> should be 1, is 1
abc ~ /ab{0}*c/ -> should be 0, is 0
ac ~ /a(b{0})*c/ -> should be 1, is 1
abc ~ /a(b{0})*c/ -> should be 0, is 0
ac ~ /ab{0,}c/ -> should be 1, is 1
abc ~ /ab{0,}c/ -> should be 1, is 1
ac ~ /a(b{0,})c/ -> should be 1, is 1
abc ~ /a(b{0,})c/ -> should be 1, is 1
ac ~ /ab{0,}*c/ -> should be 1, is 1
abc ~ /ab{0,}*c/ -> should be 1, is 1
ac ~ /a(b{0,})*c/ -> should be 1, is 1
abc ~ /a(b{0,})*c/ -> should be 1, is 1
ac ~ /ab{1}c/ -> should be 0, is 0
abc ~ /ab{1}c/ -> should be 1, is 1
abbc ~ /ab{1}c/ -> should be 0, is 0

View File

@ -382,7 +382,7 @@ $awk 'BEGIN \
print "hello, world"
}
}}}' >foo1 2>foo2
grep 'source line 5' foo2 >/dev/null 2>&1 || echo 'BAD: T.misc continuation line number'
grep 'source line 4' foo2 >/dev/null 2>&1 || echo 'BAD: T.misc continuation line number'
echo 111 222 333 >foo