diff options
author | Matthias Kilian <kili@cvs.openbsd.org> | 2007-02-13 21:48:21 +0000 |
---|---|---|
committer | Matthias Kilian <kili@cvs.openbsd.org> | 2007-02-13 21:48:21 +0000 |
commit | dc47ed54edcad7832fe0403f0d3a3ddefd4397ff (patch) | |
tree | e54d630d24e4456a7facdca9f9704f4754aaac25 /regress/usr.bin | |
parent | 77abb3cc848e95932412e3ce6f2766d0f5494fe9 (diff) |
- Be explicit on command line checking, instead of relying on patterns,
which may be NULL (e.g. -e '').
- let add_pattern() decide how to deal with empty patterns, don't do
magic in read_patterns().
This unbreaks stuff like grep -e '', and makes grep -f <file> more
POSIX compliant. Semantics for grep -f /dev/null (or any other empty
file) may be questionable, but this case isn't specified by POSIX,
and matching nothing at all seems to be sane.
Thanks to otto@, who mentioned potential problems related to the
-x option with the first patch i sent.
ok jaredy@ (some time ago), otto@, millert@
Diffstat (limited to 'regress/usr.bin')
-rw-r--r-- | regress/usr.bin/grep/Makefile | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/regress/usr.bin/grep/Makefile b/regress/usr.bin/grep/Makefile index e590df2bb6a..4785a837f89 100644 --- a/regress/usr.bin/grep/Makefile +++ b/regress/usr.bin/grep/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.12 2005/04/03 19:15:17 otto Exp $ +# $OpenBSD: Makefile,v 1.13 2007/02/13 21:48:20 kili Exp $ REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 \ t18 t19 t20 t21 t22 t23 @@ -91,7 +91,13 @@ t22: t23: egrep -w 'word1|word2|word3' ${.CURDIR}/t23.in +t24: + grep -e '' < in | diff - in + grep -x -e '' < in | diff - /dev/null + grep -f /dev/null < in | diff - /dev/null + + .PHONY: t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 -.PHONY: t21 t22 t23 +.PHONY: t21 t22 t23 t24 .include <bsd.regress.mk> |