[Midnightbsd-cvs] src [10458] trunk/gnu/usr.bin/grep: tag and bring in a few minor patches

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Jun 6 19:52:20 EDT 2018


Revision: 10458
          http://svnweb.midnightbsd.org/src/?rev=10458
Author:   laffer1
Date:     2018-06-06 19:52:19 -0400 (Wed, 06 Jun 2018)
Log Message:
-----------
tag and bring in a few minor patches

Modified Paths:
--------------
    trunk/gnu/usr.bin/grep/Makefile
    trunk/gnu/usr.bin/grep/closeout.c
    trunk/gnu/usr.bin/grep/closeout.h
    trunk/gnu/usr.bin/grep/config.h
    trunk/gnu/usr.bin/grep/dfa.c
    trunk/gnu/usr.bin/grep/dfa.h
    trunk/gnu/usr.bin/grep/error.c
    trunk/gnu/usr.bin/grep/error.h
    trunk/gnu/usr.bin/grep/exclude.c
    trunk/gnu/usr.bin/grep/exclude.h
    trunk/gnu/usr.bin/grep/getpagesize.h
    trunk/gnu/usr.bin/grep/grep.c
    trunk/gnu/usr.bin/grep/grep.h
    trunk/gnu/usr.bin/grep/grepmat.c
    trunk/gnu/usr.bin/grep/hard-locale.c
    trunk/gnu/usr.bin/grep/hard-locale.h
    trunk/gnu/usr.bin/grep/isdir.c
    trunk/gnu/usr.bin/grep/kwset.c
    trunk/gnu/usr.bin/grep/kwset.h
    trunk/gnu/usr.bin/grep/obstack.c
    trunk/gnu/usr.bin/grep/obstack.h
    trunk/gnu/usr.bin/grep/quotearg.c
    trunk/gnu/usr.bin/grep/quotearg.h
    trunk/gnu/usr.bin/grep/savedir.c
    trunk/gnu/usr.bin/grep/savedir.h
    trunk/gnu/usr.bin/grep/search.c
    trunk/gnu/usr.bin/grep/system.h
    trunk/gnu/usr.bin/grep/xalloc.h
    trunk/gnu/usr.bin/grep/xmalloc.c
    trunk/gnu/usr.bin/grep/xstrtol.c
    trunk/gnu/usr.bin/grep/xstrtol.h
    trunk/gnu/usr.bin/grep/xstrtoumax.c

Modified: trunk/gnu/usr.bin/grep/Makefile
===================================================================
--- trunk/gnu/usr.bin/grep/Makefile	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/Makefile	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,5 +1,5 @@
 # $MidnightBSD$
-# $FreeBSD: src/gnu/usr.bin/grep/Makefile,v 1.30 2004/07/04 10:05:37 tjr Exp $
+# $FreeBSD: stable/10/gnu/usr.bin/grep/Makefile 270776 2014-08-29 01:20:31Z gjb $
 
 .include <bsd.own.mk>
 
@@ -13,6 +13,7 @@
 SRCS=	closeout.c dfa.c error.c exclude.c grep.c grepmat.c hard-locale.c \
 	isdir.c kwset.c obstack.c quotearg.c savedir.c search.c xmalloc.c \
 	xstrtoumax.c
+CLEANFILES+=	gnugrep.1
 
 CFLAGS+=-I${.CURDIR} -I${DESTDIR}/usr/include/gnu -DHAVE_CONFIG_H
 

Modified: trunk/gnu/usr.bin/grep/closeout.c
===================================================================
--- trunk/gnu/usr.bin/grep/closeout.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/closeout.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* closeout.c - close standard output
    Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/closeout.h
===================================================================
--- trunk/gnu/usr.bin/grep/closeout.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/closeout.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 #ifndef CLOSEOUT_H
 # define CLOSEOUT_H 1
 

Modified: trunk/gnu/usr.bin/grep/config.h
===================================================================
--- trunk/gnu/usr.bin/grep/config.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/config.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* $FreeBSD: src/gnu/usr.bin/grep/config.h,v 1.9 2004/08/12 06:45:31 tjr Exp $ */
 /* config.h.  Generated by configure.  */
 /* config.hin.  Generated from configure.in by autoheader.  */

Modified: trunk/gnu/usr.bin/grep/dfa.c
===================================================================
--- trunk/gnu/usr.bin/grep/dfa.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/dfa.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* dfa.c - deterministic extended regexp routines for GNU
    Copyright 1988, 1998, 2000 Free Software Foundation, Inc.
 
@@ -18,7 +19,7 @@
 /* Written June, 1988 by Mike Haertel
    Modified July, 1988 by Arthur David Olson to assist BMG speedups  */
 
-/* $FreeBSD: src/gnu/usr.bin/grep/dfa.c,v 1.21 2005/05/14 03:18:20 tjr Exp $ */
+/* $FreeBSD: stable/10/gnu/usr.bin/grep/dfa.c 250823 2013-05-20 03:15:25Z pfg $ */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>

Modified: trunk/gnu/usr.bin/grep/dfa.h
===================================================================
--- trunk/gnu/usr.bin/grep/dfa.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/dfa.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* dfa.h - declarations for GNU deterministic regexp compiler
    Copyright (C) 1988, 1998 Free Software Foundation, Inc.
 
@@ -17,7 +18,7 @@
 
 /* Written June, 1988 by Mike Haertel */
 
-/* $FreeBSD: src/gnu/usr.bin/grep/dfa.h,v 1.9 2005/05/14 03:02:22 tjr Exp $ */
+/* $FreeBSD: stable/10/gnu/usr.bin/grep/dfa.h 146199 2005-05-14 03:02:22Z tjr $ */
 
 /* FIXME:
    2.  We should not export so much of the DFA internals.

Modified: trunk/gnu/usr.bin/grep/error.c
===================================================================
--- trunk/gnu/usr.bin/grep/error.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/error.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* Error handler for noninteractive utilities
    Copyright (C) 1990-1998, 2000 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/error.h
===================================================================
--- trunk/gnu/usr.bin/grep/error.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/error.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* Declaration for error-reporting function
    Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/exclude.c
===================================================================
--- trunk/gnu/usr.bin/grep/exclude.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/exclude.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* exclude.c -- exclude file names
    Copyright 1992, 1993, 1994, 1997, 1999, 2000 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/exclude.h
===================================================================
--- trunk/gnu/usr.bin/grep/exclude.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/exclude.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* exclude.h -- declarations for excluding file names
    Copyright 1992, 1993, 1994, 1997, 1999 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/getpagesize.h
===================================================================
--- trunk/gnu/usr.bin/grep/getpagesize.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/getpagesize.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,6 +1,7 @@
+/* $MidnightBSD$ */
 /* Emulate getpagesize on systems that lack it.  */
 
-/* $FreeBSD: src/gnu/usr.bin/grep/getpagesize.h,v 1.7 2004/07/04 10:02:03 tjr Exp $ */
+/* $FreeBSD: stable/10/gnu/usr.bin/grep/getpagesize.h 131557 2004-07-04 10:02:03Z tjr $ */
 
 #ifndef HAVE_GETPAGESIZE
 

Modified: trunk/gnu/usr.bin/grep/grep.c
===================================================================
--- trunk/gnu/usr.bin/grep/grep.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/grep.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* grep.c - main driver file for grep.
    Copyright 1992, 1997-1999, 2000 Free Software Foundation, Inc.
 
@@ -19,7 +20,7 @@
 /* Written July 1992 by Mike Haertel.  */
 /* Builtin decompression 1997 by Wolfram Schneider <wosch at FreeBSD.org>.  */
 
-/* $FreeBSD: src/gnu/usr.bin/grep/grep.c,v 1.31.2.1 2005/10/26 21:13:30 jkim Exp $ */
+/* $FreeBSD: stable/10/gnu/usr.bin/grep/grep.c 254093 2013-08-08 11:53:47Z ache $ */
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
@@ -301,14 +302,16 @@
       error (0, errno, "fstat");
       return 0;
     }
-  if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
-    return 0;
+  if (fd != STDIN_FILENO) {
+    if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
+      return 0;
 #ifndef DJGPP
-  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode)))
+    if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode) || S_ISFIFO(stats->stat.st_mode)))
 #else
-  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
+    if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
 #endif
-    return 0;
+      return 0;
+  }
   if (
       BZflag ||
 #if HAVE_LIBZ > 0
@@ -942,6 +945,7 @@
   int desc;
   int count;
   int status;
+  int flags;
 
   if (! file)
     {
@@ -950,7 +954,7 @@
     }
   else
     {
-      while ((desc = open (file, O_RDONLY)) < 0 && errno == EINTR)
+      while ((desc = open (file, O_RDONLY | O_NONBLOCK)) < 0 && errno == EINTR)
 	continue;
 
       if (desc < 0)
@@ -990,6 +994,9 @@
 	  return 1;
 	}
 
+      flags = fcntl(desc, F_GETFL);
+      flags &= ~O_NONBLOCK;
+      fcntl(desc, F_SETFL, flags);
       filename = file;
     }
 

Modified: trunk/gnu/usr.bin/grep/grep.h
===================================================================
--- trunk/gnu/usr.bin/grep/grep.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/grep.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* grep.h - interface to grep driver for searching subroutines.
    Copyright (C) 1992, 1998, 2001 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/grepmat.c
===================================================================
--- trunk/gnu/usr.bin/grep/grepmat.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/grepmat.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif

Modified: trunk/gnu/usr.bin/grep/hard-locale.c
===================================================================
--- trunk/gnu/usr.bin/grep/hard-locale.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/hard-locale.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* hard-locale.c -- Determine whether a locale is hard.
    Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/hard-locale.h
===================================================================
--- trunk/gnu/usr.bin/grep/hard-locale.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/hard-locale.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 #ifndef HARD_LOCALE_H_
 # define HARD_LOCALE_H_ 1
 

Modified: trunk/gnu/usr.bin/grep/isdir.c
===================================================================
--- trunk/gnu/usr.bin/grep/isdir.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/isdir.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* isdir.c -- determine whether a directory exists
    Copyright (C) 1990, 1998 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/kwset.c
===================================================================
--- trunk/gnu/usr.bin/grep/kwset.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/kwset.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* kwset.c - search for any of a set of keywords.
    Copyright 1989, 1998, 2000 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/kwset.h
===================================================================
--- trunk/gnu/usr.bin/grep/kwset.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/kwset.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* kwset.h - header declaring the keyword set library.
    Copyright (C) 1989, 1998 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/obstack.c
===================================================================
--- trunk/gnu/usr.bin/grep/obstack.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/obstack.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* obstack.c - subroutines used implicitly by object stack macros
    Copyright (C) 1988-1994,96,97,98,99 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/obstack.h
===================================================================
--- trunk/gnu/usr.bin/grep/obstack.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/obstack.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* obstack.h - object stack macros
    Copyright (C) 1988,89,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/quotearg.c
===================================================================
--- trunk/gnu/usr.bin/grep/quotearg.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/quotearg.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* quotearg.c - quote arguments for output
    Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/quotearg.h
===================================================================
--- trunk/gnu/usr.bin/grep/quotearg.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/quotearg.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* quotearg.h - quote arguments for output
    Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/savedir.c
===================================================================
--- trunk/gnu/usr.bin/grep/savedir.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/savedir.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* savedir.c -- save the list of files in a directory in a string
    Copyright (C) 1990, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 
@@ -17,6 +18,9 @@
 
 /* Written by David MacKenzie <djm at gnu.ai.mit.edu>. */
 
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/gnu/usr.bin/grep/savedir.c 187907 2009-01-30 00:22:08Z obrien $");
+
 #if HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -137,10 +141,10 @@
 	      && !isdir1 (dir, dp->d_name))
 	    {
 	      if (included_patterns
-		  && !excluded_filename (included_patterns, dp->d_name, 0))
+		  && !excluded_filename (included_patterns, path, 0))
 		continue;
 	      if (excluded_patterns
-		  && excluded_filename (excluded_patterns, dp->d_name, 0))
+		  && excluded_filename (excluded_patterns, path, 0))
 		continue;
 	    }
 

Modified: trunk/gnu/usr.bin/grep/savedir.h
===================================================================
--- trunk/gnu/usr.bin/grep/savedir.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/savedir.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 #if !defined SAVEDIR_H_
 # define SAVEDIR_H_
 

Modified: trunk/gnu/usr.bin/grep/search.c
===================================================================
--- trunk/gnu/usr.bin/grep/search.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/search.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* search.c - searching subroutines using dfa, kwset and regex for grep.
    Copyright 1992, 1998, 2000 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/system.h
===================================================================
--- trunk/gnu/usr.bin/grep/system.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/system.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* Portability cruft.  Include after config.h and sys/types.h.
    Copyright 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/xalloc.h
===================================================================
--- trunk/gnu/usr.bin/grep/xalloc.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/xalloc.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* xalloc.h -- malloc with out-of-memory checking
    Copyright (C) 1990-1998, 1999, 2000 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/xmalloc.c
===================================================================
--- trunk/gnu/usr.bin/grep/xmalloc.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/xmalloc.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* xmalloc.c -- malloc with out of memory checking
    Copyright (C) 1990-1999, 2000 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/xstrtol.c
===================================================================
--- trunk/gnu/usr.bin/grep/xstrtol.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/xstrtol.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* A more useful interface to strtol.
    Copyright (C) 1995, 1996, 1998-2000 Free Software Foundation, Inc.
 

Modified: trunk/gnu/usr.bin/grep/xstrtol.h
===================================================================
--- trunk/gnu/usr.bin/grep/xstrtol.h	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/xstrtol.h	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 #ifndef XSTRTOL_H_
 # define XSTRTOL_H_ 1
 

Modified: trunk/gnu/usr.bin/grep/xstrtoumax.c
===================================================================
--- trunk/gnu/usr.bin/grep/xstrtoumax.c	2018-06-06 23:51:06 UTC (rev 10457)
+++ trunk/gnu/usr.bin/grep/xstrtoumax.c	2018-06-06 23:52:19 UTC (rev 10458)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /* xstrtoumax.c -- A more useful interface to strtoumax.
    Copyright 1999 Free Software Foundation, Inc.
 



More information about the Midnightbsd-cvs mailing list