From nobody@FreeBSD.org  Sat Jan 30 08:51:43 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E4DE106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 30 Jan 2010 08:51:43 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E4DA8FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 30 Jan 2010 08:51:43 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o0U8pgE9071572
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 30 Jan 2010 08:51:42 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o0U8pgDg071571;
	Sat, 30 Jan 2010 08:51:42 GMT
	(envelope-from nobody)
Message-Id: <201001300851.o0U8pgDg071571@www.freebsd.org>
Date: Sat, 30 Jan 2010 08:51:42 GMT
From: Mikolaj Golub <to.my.trociny@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: awk(1) incorrect matching
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         143362
>Category:       bin
>Synopsis:       awk(1) incorrect matching
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 30 09:00:02 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Mikolaj Golub
>Release:        FreeBSD zhuzha.ua1 8.0-STABLE FreeBSD 8.0-STABLE #6: Sun Jan 24 21:36:17 EET 2010     root@zhuzha.ua1:/usr/obj/usr/src/sys/GENERIC  i386
>Organization:
>Environment:
>Description:
This problem with awk(1) was reported to NetBSD by Aleksey Cheusov

http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=33392

The same issue is under FreeBSD:

The following program
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#!/usr/bin/awk -f


/^[^_][^ ]*_NNIFO([ ]+[^_][^ ]*_(CC|INR|JJFO|JJMA|JJPG|NNIFG|NNIFO|NNIMPG|NNIMR|NNING|PP3FD|PQINO|PQMO|PSFR|RQ|TC|VIIR3|VPIPN|VPLIPF|NOTAG|RQR))*$/
%%%%%%%%%%%%%%%%%%%%% end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


doesn't match the following input


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1_NNIFO 1_PSFR 1_JJFO 1_NNIFO 1_INR 1_NNIMR 1_CC 1_NNING 1_RQ 1_VPLIPF 1_NNIFG 1_JJPG 1_NNIMPG 1_PQINO 1_VPIPN 1_PP3FD 1_JJMA 1_PQMO 1_TC 1_VIIR3
%%%%%%%%%%%%%%%%%%%%% end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Input is 145 byte in size.
Exactly one space between tokens.

>How-To-Repeat:

>Fix:
It has been fixed in NetBSD so we could use their solution.

>Release-Note:
>Audit-Trail:
>Unformatted:
