diff options
Diffstat (limited to 'usr.bin/grep')
-rw-r--r-- | usr.bin/grep/Makefile | 6 | ||||
-rw-r--r-- | usr.bin/grep/regex/tre-fastmatch.c | 2 | ||||
-rw-r--r-- | usr.bin/grep/tests/Makefile | 41 | ||||
-rw-r--r-- | usr.bin/grep/util.c | 2 |
4 files changed, 48 insertions, 3 deletions
diff --git a/usr.bin/grep/Makefile b/usr.bin/grep/Makefile index c0c24dc..32941fd 100644 --- a/usr.bin/grep/Makefile +++ b/usr.bin/grep/Makefile @@ -11,7 +11,7 @@ PROG= bsdgrep CLEANFILES+= bsdgrep.1 bsdgrep.1: grep.1 - cp ${.ALLSRC} ${.TARGET} + cp -f ${.ALLSRC} ${.TARGET} .endif SRCS= file.c grep.c queue.c util.c @@ -85,4 +85,8 @@ DPADD+= ${LIBGNUREGEX} CFLAGS+= -DWITHOUT_NLS .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include <bsd.prog.mk> diff --git a/usr.bin/grep/regex/tre-fastmatch.c b/usr.bin/grep/regex/tre-fastmatch.c index eddab26..0881c55 100644 --- a/usr.bin/grep/regex/tre-fastmatch.c +++ b/usr.bin/grep/regex/tre-fastmatch.c @@ -727,7 +727,7 @@ badpat: for (unsigned int i = 0; i < fg->len; i++) if (fg->pattern[i] == '\\') escaped = !escaped; - else if (fg->pattern[i] == '.' && escaped) + else if (fg->pattern[i] == '.' && fg->escmap && escaped) { fg->escmap[i] = true; escaped = false; diff --git a/usr.bin/grep/tests/Makefile b/usr.bin/grep/tests/Makefile new file mode 100644 index 0000000..59b948c --- /dev/null +++ b/usr.bin/grep/tests/Makefile @@ -0,0 +1,41 @@ +# $FreeBSD$ + +TESTSRC= ${.CURDIR}/../../../contrib/netbsd-tests/usr.bin/grep +.PATH: ${TESTSRC} + +.include <bsd.own.mk> + +TESTSDIR= ${TESTSBASE}/usr.bin/grep + +ATF_TESTS_SH= grep_test +ATF_TESTS_SH_SRC_grep_test= t_grep.sh + +FILESDIR= ${TESTSDIR} +FILES= d_basic.out +FILES+= d_begin_end_a.out +FILES+= d_begin_end_b.out +FILES+= d_binary.out +FILES+= d_context2_a.out +FILES+= d_context2_b.out +FILES+= d_context2_c.out +FILES+= d_context_a.in +FILES+= d_context_a.out +FILES+= d_context_b.in +FILES+= d_context_b.out +FILES+= d_context_c.out +FILES+= d_context_d.out +FILES+= d_egrep.out +FILES+= d_file_exp.in +FILES+= d_file_exp.out +FILES+= d_ignore_case.out +FILES+= d_input +FILES+= d_invert.in +FILES+= d_invert.out +FILES+= d_recurse.out +FILES+= d_recurse_symlink.err +FILES+= d_recurse_symlink.out +FILES+= d_whole_line.out +FILES+= d_word_regexps.out +FILES+= d_zgrep.out + +.include <bsd.test.mk> diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index 3ec12fa..f3cf05f 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -336,7 +336,7 @@ procline(struct str *l, int nottext) } /* One pass if we are not recording matches */ - if (!wflag && ((color == NULL && !oflag) || qflag || lflag)) + if (!wflag && ((color == NULL && !oflag) || qflag || lflag || Lflag)) break; if (st == (size_t)pmatch.rm_so) |