diff options
author | ru <ru@FreeBSD.org> | 2000-01-18 09:45:11 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2000-01-18 09:45:11 +0000 |
commit | 36e4acc76686203ceb3d56bc37ea3afdcfc5c6cb (patch) | |
tree | 0aceccf601aa7b42e9a4e48ecf5a502e7068e9db | |
parent | e4a289662ab58761c02de091ccec74d478a16305 (diff) | |
parent | 5b9b49c3cdaddcc4b57202e7fdf055ca9a17cf4b (diff) | |
download | FreeBSD-src-36e4acc76686203ceb3d56bc37ea3afdcfc5c6cb.zip FreeBSD-src-36e4acc76686203ceb3d56bc37ea3afdcfc5c6cb.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r56230,
which included commits to RCS files with non-trunk default branches.
-rw-r--r-- | gnu/usr.bin/grep/ChangeLog | 31 | ||||
-rw-r--r-- | gnu/usr.bin/grep/NEWS | 7 | ||||
-rw-r--r-- | gnu/usr.bin/grep/THANKS | 1 | ||||
-rw-r--r-- | gnu/usr.bin/grep/doc/grep.texi | 27 | ||||
-rw-r--r-- | gnu/usr.bin/grep/doc/version.texi | 6 | ||||
-rw-r--r-- | gnu/usr.bin/grep/savedir.c | 6 | ||||
-rw-r--r-- | gnu/usr.bin/grep/system.h | 13 |
7 files changed, 69 insertions, 22 deletions
diff --git a/gnu/usr.bin/grep/ChangeLog b/gnu/usr.bin/grep/ChangeLog index 3855810..8106528 100644 --- a/gnu/usr.bin/grep/ChangeLog +++ b/gnu/usr.bin/grep/ChangeLog @@ -1,3 +1,22 @@ +2000-01-04 Paul Eggert + + Inititial patch from David O'Brien. + + Add --binary-files option. + * NEWS, doc/grep.1, doc/grep.texi: Document it. + * src/grep.c (BINARY_FILES_OPTION): New constant. + (long_options, grep, usage, main): New --binary-files option. + (binary_files): New var. + * src/system.h (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, CHAR_MAX): + New macros. + (INT_MAX, UCHAR_MAX): Define in terms of TYPE_MAXIMUM. + +2000-01-04 Paul Eggert + + * savedir.c (savedir): Don't store past the end of an array if + name_size is zero and the directory is empty. + Reported by Dima Barsky <dima@pwd.hp.com>. + 1999-11-18 Paul Eggert * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a @@ -46,8 +65,8 @@ * configure.in: drop support for --without-included-regex. This was generating bogus bug reports, since many GNU/Linux users have different version of glibc. And glibc maintainers - decided to drop k&r support. - + decided to drop k&r support. + 1999-11-01 Arnold D. Robbins * regex.c (init_syntax_once): move below definition of @@ -302,7 +321,7 @@ axes.) 1999-06-15 Alain Magloire - * src/grep.c, doc/grep{1,texi} : + * src/grep.c, doc/grep{1,texi} : --revert-match should be --invert-match. Correction proposed by Karl Berry. @@ -337,7 +356,7 @@ axes.) 1999-03-05 Eli Zaretskii * src/grep.c (main): Print the name of the default matcher instead - of just "grep". + of just "grep". 1999-02-06 Alain Magloire @@ -349,7 +368,7 @@ axes.) the input is drained, like this: status=`echo 'check' | { ${GREP} -E -e pattern >/dev/null 2>&1; echo $?; cat >/dev/null; }`; if test $status -ne $errnu then ... fi - Excerpt email from Andreas Schwab. + Excerpt email from Andreas Schwab. 1999-02-23 Alain Magloire @@ -470,7 +489,7 @@ axes.) * PATCHES-AM: New file. A small patch for automake-1.4, use $(sep) as the path separator base on @SEP@. * PATCHES-AC configure.in : updated for autoconf-13. - + 1999-01-27 Volker Borchert * grep.c: fgrep -NUM not working correctly. diff --git a/gnu/usr.bin/grep/NEWS b/gnu/usr.bin/grep/NEWS index efeaf41..88701af 100644 --- a/gnu/usr.bin/grep/NEWS +++ b/gnu/usr.bin/grep/NEWS @@ -1,3 +1,10 @@ + - The new option --binary-files=TYPE makes grep assume that a binary input + file is of type TYPE. + --binary-files='binary' (the default) outputs a 1-line summary of matches. + --binary-files='without-match' assumes binary files do not match. + --binary-files='text' treats binary files as text + (equivalent to -a or --text). + Version 2.4: - egrep is now equivalent to `grep -E' as required by POSIX, diff --git a/gnu/usr.bin/grep/THANKS b/gnu/usr.bin/grep/THANKS index 924b6cf..75ecc46 100644 --- a/gnu/usr.bin/grep/THANKS +++ b/gnu/usr.bin/grep/THANKS @@ -4,6 +4,7 @@ Andreas Schwab <schwab@suse.de> Andreas Ley <andy@rz.uni-karlsruhe.de> Ben Elliston <bje@cygnus.com> David J MacKenzie <djm@catapult.va.pubnix.com> +David O'Brien <obrien@freebsd.org> Eli Zaretskii <eliz@is.elta.co.il> Florian La Roche <florian@knorke.saar.de> Franc,ois Pinard <pinard@IRO.UMontreal.CA> diff --git a/gnu/usr.bin/grep/doc/grep.texi b/gnu/usr.bin/grep/doc/grep.texi index 50a6938..d71f2c1 100644 --- a/gnu/usr.bin/grep/doc/grep.texi +++ b/gnu/usr.bin/grep/doc/grep.texi @@ -275,6 +275,21 @@ This version number should be included in all bug reports. Print a usage message briefly summarizing these command-line options and the bug-reporting address, then exit. +@itemx --binary-files=@var{type} +@opindex --binary-files +@cindex binary files +If the first few bytes of a file indicate that the file contains binary +data, assume that the file is of type @var{type}. By default, +@var{type} is @samp{binary}, and @command{grep} normally outputs either +a one-line message saying that a binary file matches, or no message if +there is no match. If @var{type} is @samp{without-match}, +@command{grep} assumes that a binary file does not match. If @var{type} +is @samp{text}, @command{grep} processes a binary file as if it were +text; this is equivalent to the @samp{-a} or @samp{--text} option. +@emph{Warning:} @samp{--binary-files=text} might output binary garbage, +which can have nasty side effects if the output is a terminal and if the +terminal driver interprets some of it as commands. + @item -b @itemx --byte-offset @opindex -b @@ -329,16 +344,8 @@ The scanning of every file will stop on the first match. @opindex --text @cindex suppress binary data @cindex binary files -Do not suppress output lines that contain binary data. -Normally, if the first few bytes of a file indicate -that the file contains binary data, grep outputs only a -message saying that the file matches the pattern. This -option causes grep to act as if the file is a text -file, even if it would otherwise be treated as binary. -@emph{Warning:} the result might be binary garbage -printed to the terminal, which can have nasty -side-effects if the terminal driver interprets some of -it as commands. +Process a binary file as if it were text; this is equivalent to the +@samp{--binary-files=text} option. @item -w @itemx --word-regexp diff --git a/gnu/usr.bin/grep/doc/version.texi b/gnu/usr.bin/grep/doc/version.texi index 2c6880e..2deace2 100644 --- a/gnu/usr.bin/grep/doc/version.texi +++ b/gnu/usr.bin/grep/doc/version.texi @@ -1,3 +1,3 @@ -@set UPDATED 13 November 1999 -@set EDITION 2.4 -@set VERSION 2.4 +@set UPDATED 16 January 2000 +@set EDITION 2.4a +@set VERSION 2.4a diff --git a/gnu/usr.bin/grep/savedir.c b/gnu/usr.bin/grep/savedir.c index 5a9c339..e329717 100644 --- a/gnu/usr.bin/grep/savedir.c +++ b/gnu/usr.bin/grep/savedir.c @@ -1,5 +1,5 @@ /* savedir.c -- save the list of files in a directory in a string - Copyright (C) 1990, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1990, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -89,6 +89,10 @@ savedir (dir, name_size) if (dirp == NULL) return NULL; + /* Be sure name_size is at least `1' so there's room for + the final NUL byte. */ + name_size += !name_size; + name_space = (char *) malloc (name_size); if (name_space == NULL) { diff --git a/gnu/usr.bin/grep/system.h b/gnu/usr.bin/grep/system.h index a6966e4..3cd9b56 100644 --- a/gnu/usr.bin/grep/system.h +++ b/gnu/usr.bin/grep/system.h @@ -127,11 +127,20 @@ void free(); #ifndef CHAR_BIT # define CHAR_BIT 8 #endif +/* The extra casts work around common compiler bugs. */ +#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) +#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \ + ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) \ + : (t) 0)) +#define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t))) +#ifndef CHAR_MAX +# define CHAR_MAX TYPE_MAXIMUM (char) +#endif #ifndef INT_MAX -# define INT_MAX 2147483647 +# define INT_MAX TYPE_MAXIMUM (int) #endif #ifndef UCHAR_MAX -# define UCHAR_MAX 255 +# define UCHAR_MAX TYPE_MAXIMUM (unsigned char) #endif #if !defined(STDC_HEADERS) && defined(HAVE_STRING_H) && defined(HAVE_MEMORY_H) |