From c617ee3eb58a78dc4a9d34a05d4e16fb0bc2d561 Mon Sep 17 00:00:00 2001 From: gabor Date: Mon, 18 Aug 2014 12:29:28 +0000 Subject: - Do not look for more matching lines if -L is specified Submitted by: eadler (based on) MFC after: 2 weeks --- usr.bin/grep/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.bin/grep') 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) -- cgit v1.1 From 8fbdaa50eadab69ef1db450a95198973f693f629 Mon Sep 17 00:00:00 2001 From: will Date: Thu, 18 Sep 2014 14:41:57 +0000 Subject: Fix incremental builds involving non-root users with read-only source files. Makefiles should not assume that source files can be overwritten. This is the common case for Perforce source trees. This is a followup commit to r211243 in the same vein. MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: r1036319 on 2014/01/29, r1046711 on 2014/03/06 --- usr.bin/grep/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.bin/grep') diff --git a/usr.bin/grep/Makefile b/usr.bin/grep/Makefile index c0c24dc..a4c614f 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 -- cgit v1.1 From be5797835fa6b8de3832f892513c42321ce722c5 Mon Sep 17 00:00:00 2001 From: pfg Date: Thu, 25 Sep 2014 19:22:26 +0000 Subject: bsdgrep: Work-around for segmentation fault. Fix by David Carlier. Obtained from: HardenedBSD PR: 167921 MFC after: 1 month --- usr.bin/grep/regex/tre-fastmatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.bin/grep') 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; -- cgit v1.1 From 9cf2b42641723fc9186176c799339e4834f76bc4 Mon Sep 17 00:00:00 2001 From: ngie Date: Thu, 9 Oct 2014 01:53:23 +0000 Subject: Integrate usr.bin/grep/tests from NetBSD into atf/kyua Sponsored by: EMC / Isilon Storage Division --- usr.bin/grep/Makefile | 4 ++++ usr.bin/grep/tests/Makefile | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 usr.bin/grep/tests/Makefile (limited to 'usr.bin/grep') diff --git a/usr.bin/grep/Makefile b/usr.bin/grep/Makefile index a4c614f..32941fd 100644 --- a/usr.bin/grep/Makefile +++ b/usr.bin/grep/Makefile @@ -85,4 +85,8 @@ DPADD+= ${LIBGNUREGEX} CFLAGS+= -DWITHOUT_NLS .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include 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 + +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 -- cgit v1.1