Date: Thu, 06 Nov 2014 03:13:43 +0300 From: Andrey Chernov <ache@freebsd.org> To: "John D. Hendrickson" <johnandsara2@cox.net>, bugzilla-noreply@freebsd.org Cc: freebsd-bugs@FreeBSD.org Subject: Re: [Bug 194823] New: "bsdgrep -E { /dev/null" core dumps Message-ID: <545ABD37.302@freebsd.org> In-Reply-To: <545ABAFC.1000807@freebsd.org> References: <BYN51p0122X408g01YN6oP> <545AA906.3070107@cox.net> <545ABAFC.1000807@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 06.11.2014 3:04, Andrey Chernov wrote: > On 06.11.2014 1:47, John D. Hendrickson wrote: >>> Summary: "bsdgrep -E { /dev/null" core dumps >> your supposed to strive to use it correctly, not strive to find ways to >> use it incorrectly >> >> how big and slow and complicated will all the binaries be if they must >> stop and check for every possible mis-use ? > > There is no misuse, just one of many bsdgrep bugs we already have. grep > is able to search and autodetect binary files. > Moreover, just single "{" is correct extended regexp. Compare with GNU grep results and grep(1) manpage: "GNU egrep attempts to support traditional usage by assuming that { is not special if it would be the start of an invalid interval specifica- tion. For example, the shell command egrep '{1' searches for the two- character string {1 instead of reporting a syntax error in the regular expression. POSIX.2 allows this behavior as an extension, but portable scripts should avoid it." In normal case it should either follow GNU grep way (no output) or produce error on wrong regexp, both ways are POSIX compatible but core dump is not. -- http://ache.vniz.net/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?545ABD37.302>