From dm@home.dinoex.sub.de  Wed Jul  2 09:48:16 2003
Return-Path: <dm@home.dinoex.sub.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DE67D37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  2 Jul 2003 09:48:16 -0700 (PDT)
Received: from uucp.dinoex.sub.de (uucp.dinoex.sub.de [212.184.201.182])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4D16A43FBF
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  2 Jul 2003 09:48:15 -0700 (PDT)
	(envelope-from dm@home.dinoex.sub.de)
Received: from home.dinoex.sub.de (home.dinoex.sub.de [217.6.200.196])
	by uucp.dinoex.sub.de (8.12.9/8.12.9) with ESMTP id h62Gm4QQ001611
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 2 Jul 2003 18:48:04 +0200 (CEST)
	(envelope-from dm@home.dinoex.sub.de)
Received: (from dm@localhost)
	by home.dinoex.sub.de (8.12.9/8.12.8/Submit) id h62Gm9AM053714;
	Wed, 2 Jul 2003 18:48:09 +0200 (CEST)
	(envelope-from dm)
Message-Id: <200307021648.h62Gm9AM053714@home.dinoex.sub.de>
Date: Wed, 2 Jul 2003 18:48:09 +0200 (CEST)
From: dirk.meyer@dinoex.sub.org
Reply-To: dirk.meyer@dinoex.sub.org
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: awk/nawk regression with LANG
X-Send-Pr-Version: 3.113
X-GNATS-Notify: freebsd-bugs

>Number:         54031
>Category:       bin
>Synopsis:       awk/nawk regression with LANG
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ru
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 02 09:50:13 PDT 2003
>Closed-Date:    Tue Jul 29 23:56:41 PDT 2003
>Last-Modified:  Tue Jul 29 23:56:41 PDT 2003
>Originator:     Dirk Meyer
>Release:        FreeBSD 5.1-STABLE i386
>Organization:
privat
>Environment:

	LANG=de_DE.ISO_8859-1

>Description:

	regexp matching in awk/nawk:

	if (c !~ /[a-zA-Z]/)

	when var c is set to value "0++" or "000"
	c ~ /[a-zA-Z]/ results in 1
	c !~ /[a-zA-Z]/ results in 0

	like when c contains a normal word.

>How-To-Repeat:

	1)
	simple test:

#!/usr/bin/awk
/[a-zA-Z]/ {
        print "Has a Letter: " $0
}
/[A-Z]/ {
        print "Has a big Letter: " $0
}
/[a-z]/ {
        print "Has a small Letter: " $0
}

	every String matches the first and third command.

samples:

Has a Letter: 
Has a small Letter: 
1
Has a Letter: 1
Has a small Letter: 1
a
Has a Letter: a
Has a small Letter: a
A
Has a Letter: A
Has a big Letter: A
Has a small Letter: A
C
Has a Letter: C
Has a big Letter: C
Has a small Letter: C
Z
Has a Letter: Z
Has a big Letter: Z
Has a small Letter: Z
]
Has a Letter: ]
Has a small Letter: ]



	2)
	start regression test (without install) in:
$ cd /usr/porst/news/cnews && make
$ cd /usr/porst/news/cnews && make test

	output:

: namecheck.awk
test " `echo | awk -f namecheck.awk`" = " empty name" ;
test " `echo a b | awk -f namecheck.awk`" = " white space in name" ;
test " `echo 'a b' | awk -f namecheck.awk`" = " white space in name" ;
test " `(echo a ; echo b) | awk -f namecheck.awk`" = " newline(s) in name" ;
chmod +x namecheck.r
sed -n '/^[^#]/p' namecheck.t >tmp.nc
./namecheck.r <tmp.nc
comp.lang.0++:
saw:
not:    name component does not contain letter
*** Error code 1

Stop in /home/image/usr/ports/current/cnews/work/util.
*** conf/inall terminated

>Fix:

	workaround:

	unset LANG:
$ export LANG=

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ru 
Responsible-Changed-By: ru 
Responsible-Changed-When: Mon Jul 21 11:24:26 PDT 2003 
Responsible-Changed-Why:  
I'm working together with Brian Kernighan on a fix. 
ETA is two weeks for an official fix to appear. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54031 
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Tue Jul 29 23:55:04 PDT 2003 
State-Changed-Why:  
Fixed in the just imported 2003/07/29 version of one-true-awk. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54031 
>Unformatted:
