From nobody@FreeBSD.org  Thu Dec 12 19:58:48 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 8C3EE4CB
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Dec 2013 19:58:48 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 77BAF1249
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Dec 2013 19:58:48 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rBCJwkSm068615
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Dec 2013 19:58:46 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rBCJwkW8068614;
	Thu, 12 Dec 2013 19:58:46 GMT
	(envelope-from nobody)
Message-Id: <201312121958.rBCJwkW8068614@oldred.freebsd.org>
Date: Thu, 12 Dec 2013 19:58:46 GMT
From: Toomas Aas <toomas.aas@raad.tartu.ee>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bsdgrep doesn't match a regular expression containing "|" against UTF-16 file
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         184733
>Category:       bin
>Synopsis:       bsdgrep(1) doesn't match a regular expression containing "|" against UTF-16 file [regression]
>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:   Thu Dec 12 20:00:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Wed Apr 16 01:05:24 UTC 2014
>Originator:     Toomas Aas
>Release:        9.2-STABLE
>Organization:
>Environment:
FreeBSD tu-134.lan 9.2-STABLE FreeBSD 9.2-STABLE #0 r259103: Sun Dec  8 22:05:30 EET 2013     toomas@tu-134.lan:/usr/obj/usr/src/sys/TU-134  amd64
>Description:
$ egrep -V
egrep (BSD grep) 2.5.1-FreeBSD

$ echo abc > testfile
$ iconv -f ASCII -t UTF-16LE testfile > utftestfile

$ egrep -c "a.b" /tmp/utftestfile
1
$ egrep -c "a.b|d" /tmp/utftestfile
0


The expected result is that the second "egrep" command should also
return 1. This works as expected when using GNU grep 2.15 installed
from ports. Also this works as expected with "bsdgrep -E" on FreeBSD
9.1 i386 system.
>How-To-Repeat:
See "Full Description"


>Fix:


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