summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2000-01-31 13:22:22 +0000
committerru <ru@FreeBSD.org>2000-01-31 13:22:22 +0000
commit4c73bf82d8fca322d2dfcb1402ef91e9bc9639c6 (patch)
treea2382ee065e677b244c0795b99f0f0226c68ce9f /gnu
parentea8283d441751b28723778db601c133b3219e96b (diff)
parentf2470891be5a41a04025c05070ba3f0b4274217f (diff)
downloadFreeBSD-src-4c73bf82d8fca322d2dfcb1402ef91e9bc9639c6.zip
FreeBSD-src-4c73bf82d8fca322d2dfcb1402ef91e9bc9639c6.tar.gz
This commit was generated by cvs2svn to compensate for changes in r56915,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/grep/ChangeLog104
-rw-r--r--gnu/usr.bin/grep/NEWS9
-rw-r--r--gnu/usr.bin/grep/THANKS4
-rw-r--r--gnu/usr.bin/grep/doc/grep.texi79
-rw-r--r--gnu/usr.bin/grep/doc/version.texi6
-rw-r--r--gnu/usr.bin/grep/getopt1.c61
-rw-r--r--gnu/usr.bin/grep/savedir.c6
-rw-r--r--gnu/usr.bin/grep/savedir.h2
-rw-r--r--gnu/usr.bin/grep/stpcpy.c4
9 files changed, 203 insertions, 72 deletions
diff --git a/gnu/usr.bin/grep/ChangeLog b/gnu/usr.bin/grep/ChangeLog
index 8106528..1e279c3 100644
--- a/gnu/usr.bin/grep/ChangeLog
+++ b/gnu/usr.bin/grep/ChangeLog
@@ -1,3 +1,107 @@
+2000-01-28 Alain Magloire
+
+ * src/grep.c (usage): The example "%s -i 'hello.*world' could
+ lead to confusion when progname is 'fgrep.
+ Noted by Akim Demaille.
+
+ * configure.in: Reenable, jm_INCLUDE_REGEX() since we now
+ track GNU lib C.
+ * src/Makefile.am: EXTRA_DIST new macros with regex.c regex.h.
+ Requested By Ulrich Drepper.
+
+2000-01-25 Paul Eggert
+
+ * src/grep.c (grep): If the final byte of an input file is not
+ a newline, grep now silently supplies one.
+ * doc/grep.texi, NEWS: Likewise.
+
+2000-01-25 Paul Eggert
+
+ * NEWS, doc/grep.1, doc/grep.texi: Add -I option.
+ * src/grep.c (short_options, usage, main): Likewise.
+
+ * doc/grep.texi: Fix some incorrect references to ASCII.
+
+2000-01-25 Paul Eggert
+
+ * doc/grep.1: Simplify synopsis; sort options; mention
+ environment variables; clean up some minor gaffes.
+
+2000-01-25 Paul Eggert
+
+ * doc/grep.texi:
+ Fix some errors in description of [:print:] and the like.
+
+2000-01-23 Paul Eggert
+
+ * src/dfa.c (FETCH, lex): Put brackets around if-body to avoid
+ GCC warning about ambiguous if-then-else.
+
+2000-01-23 Paul Eggert
+
+ * src/regex.c (GET_UNSIGNED_NUMBER): Allow only ASCII digits.
+ * src/dfa.c (ISASCIIDIGIT): New macro.
+ (lex): Use it instead of ISDIGIT.
+
+2000-01-23 Paul Eggert
+
+ The bug is that regular expression ranges like [a-z] compare raw
+ byte codes to the range boundaries, whereas POSIX says that they
+ should use the current collating sequence instead. For example,
+ in Solaris 7 with LC_ALL=en_US, the command
+ echo x | grep '[ -~]'
+ outputs 'x', but it shouldn't output anything since ' ' and '~'
+ sort before all letters in that locale.
+
+ * src/regex.c (compile_range): When matching a character
+ range, use the current collating sequence, as POSIX requires.
+ * src/dfa.c (lex): Likewise.
+
+2000-01-20 Alain Magloire
+
+ * tests/Makefile.am (dist-hook): Added new rule to make sure
+ that the shell scripts have the right permissions.
+ * src/posix/Makefile.am (EXTRA_DIST): added regex.h in the
+ distribution.
+ * THANKS: updated.
+
+2000-01-18 Alain Magloire
+
+ * Rectification the initial patch to add --binary-file option
+ was done by Ruslan Ermilov.
+
+2000-01-17 Paul Eggert
+
+ Sync with sources of fileutils 4.0n, tar 1.13.17, glibc 2.1.3a1.
+ Convert to ANSI C prototypes (using ansi2knr for backwards
+ compatibility), as this makes it easier to sync.
+
+ * configure.in (AC_OBJEXT): Spell in a funny way, to work around
+ a bug in automake 1.4 with ansi2knr.
+ (LIBOBJS): Add assignment so that .o files in LIBOBJS are also built
+ via the ANSI2KNR-filtering rules.
+ (AC_OUTPUT): Add src/posix/Makefile.
+ * src/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
+ (SUBDIRS): New macro.
+ * src/ansi2knr.1, src/ansi2knr.c, src/posix/Makefile.am: New files.
+ * src/dfa.c, src/dosbuf.c, src/grep.c, src/kwset.c, src/search.c,
+ src/vms_fab.c:
+ Use prototypes for function definitions.
+ * src/grep.c (main): Use int counter for default context,
+ fixing an ANSI portability bug uncovered by the above changes.
+
+ * config.guess, config.sub, install-sh, missing, src/alloca.c,
+ src/getpagesize.h, src/memchr.c, src/savedir.c, src/savedir.h,
+ src/stpcpy.c:
+ Upgrade to latest version from fileutils 4.0n.
+
+ * src/getopt.c, src/getopt.h, src/getopt1.c: Upgrade to latest
+ version from tar 1.13.17.
+
+ * src/obstack.c, src/obstack.h, src/regex.c, src/regex.h:
+ Upgrade to glibc 2.1.3 alpha 1, with K&R C portability fix.
+ * src/posix/regex.h: New file, from glibc 2.1.3 alpha 1.
+
2000-01-04 Paul Eggert
Inititial patch from David O'Brien.
diff --git a/gnu/usr.bin/grep/NEWS b/gnu/usr.bin/grep/NEWS
index 88701af..e763647 100644
--- a/gnu/usr.bin/grep/NEWS
+++ b/gnu/usr.bin/grep/NEWS
@@ -1,9 +1,16 @@
+Version 2.4.1
+
+ - If the final byte of an input file is not a newline, grep now silently
+ supplies one.
+
- 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).
+ (equivalent to the -a or --text option).
+
+ - New option -I; equivalent to --binary-files='without-match'.
Version 2.4:
diff --git a/gnu/usr.bin/grep/THANKS b/gnu/usr.bin/grep/THANKS
index 75ecc46..b0c23f9 100644
--- a/gnu/usr.bin/grep/THANKS
+++ b/gnu/usr.bin/grep/THANKS
@@ -1,5 +1,6 @@
Aharon Robbins <arnold@gnu.org>
-Alain Magloire <alainm@rcsm.ece.mcgill.ca>
+Akim Demaille <akim@epita.fr>
+Alain Magloire <alainm@gnu.org>
Andreas Schwab <schwab@suse.de>
Andreas Ley <andy@rz.uni-karlsruhe.de>
Ben Elliston <bje@cygnus.com>
@@ -34,6 +35,7 @@ Phillip C. Brisco <phillip.craig.brisco@ccmail.census.gov>
Philippe Defert <Philippe.Defert@cern.ch>
Philippe De Muyter <phdm@info.ucl.ac.be>
Roland Roberts <rroberts@muller.com>
+Ruslan Ermilov <ru@freebsd.org>
Shannon Hill <hill@synnet.com>
Sotiris Vassilopoulos <Sotiris.Vassilopoulos@betatech.gr>
Stewart Levin <stew@sep.stanford.edu>
diff --git a/gnu/usr.bin/grep/doc/grep.texi b/gnu/usr.bin/grep/doc/grep.texi
index d71f2c1..49493de 100644
--- a/gnu/usr.bin/grep/doc/grep.texi
+++ b/gnu/usr.bin/grep/doc/grep.texi
@@ -126,7 +126,13 @@ This document was produced for version @value{VERSION} of @sc{gnu}
for lines containing a match to a given
pattern list. When it finds a match in a line, it copies the line to standard
output (by default), or does whatever other sort of output you have requested
-with options. @command{grep} expects to do the matching on text.
+with options.
+
+Though @command{grep} expects to do the matching on text,
+it has no limits on input line length other than available memory,
+and it can match arbitrary characters within a line.
+If the final byte of an input file is not a newline,
+@command{grep} silently supplies one.
Since newline is also a separator for the list of patterns, there
is no way to match newline characters in a text.
@@ -283,9 +289,10 @@ 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}
+@command{grep} assumes that a binary file does not match;
+this is equivalent to the @samp{-I} option. 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.
+text; this is equivalent to the @samp{-a} 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.
@@ -347,6 +354,10 @@ The scanning of every file will stop on the first match.
Process a binary file as if it were text; this is equivalent to the
@samp{--binary-files=text} option.
+@item -I
+Process a binary file as if it did not contain matching data; this is
+equivalent to the @samp{--binary-files=without-match} option.
+
@item -w
@itemx --word-regexp
@opindex -w
@@ -457,9 +468,10 @@ Grep's behavior is affected by the following environment variables.
@vindex GREP_OPTIONS
@cindex default options environment variable
This variable specifies default options to be placed in front of any
-explicit options. For example, if @code{GREP_OPTIONS} is @samp{--text
---directories=skip}, @command{grep} behaves as if the two options
-@samp{--text} and @samp{--directories=skip} had been specified before
+explicit options. For example, if @code{GREP_OPTIONS} is
+@samp{--binary-files=without-match --directories=skip}, @command{grep}
+behaves as if the two options @samp{--binary-files=without-match} and
+@samp{--directories=skip} had been specified before
any explicit options. Option specifications are separated by
whitespace. A backslash escapes the next character, so it can be used to
specify an option containing whitespace or a backslash.
@@ -595,7 +607,7 @@ single character in that list; if the first character of the list is the
caret @samp{^}, then it
matches any character @strong{not} in the list. For example, the regular
expression @samp{[0123456789]} matches any single digit.
-A range of @sc{ascii} characters may be specified by giving the first
+A range of characters may be specified by giving the first
and last characters, separated by a hyphen.
Finally, certain named classes of characters are predefined, as follows.
@@ -610,74 +622,83 @@ if no @code{LC_CTYPE} locale is specified.
@item [:alnum:]
@opindex alnum
@cindex alphanumeric characters
-Any of @samp{[:digit:]} or @samp{[:alpha:]}
+Alphanumeric characters:
+@samp{[:alpha:]} and @samp{[:digit:]}.
@item [:alpha:]
@opindex alpha
@cindex alphabetic characters
-Any letter:@*
-@code{a b c d e f g h i j k l m n o p q r s t u v w x y z},@*
-@code{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}.
+Alphabetic characters:
+@samp{[:lower:]} and @samp{[:upper:]}.
@item [:blank:]
@opindex blank
@cindex blank characters
-Space or tab.
+Blank characters:
+space and tab.
@item [:cntrl:]
@opindex cntrl
@cindex control characters
-Any character with octal codes 000 through 037, or @code{DEL} (octal
-code 177).
+Control characters. In @sc{ascii}, these characters have octal codes 000
+through 037, and 177 (@code{DEL}). In other character sets, these are
+the equivalent characters, if any.
@item [:digit:]
@opindex digit
@cindex digit characters
@cindex numeric characters
-Any one of @code{0 1 2 3 4 5 6 7 8 9}.
+Digits: @code{0 1 2 3 4 5 6 7 8 9}.
@item [:graph:]
@opindex graph
@cindex graphic characters
-Anything that is not a @samp{[:alnum:]} or @samp{[:punct:]}.
+Graphical characters:
+@samp{[:alnum:]} and @samp{[:punct:]}.
@item [:lower:]
@opindex lower
-@cindex lower-case alphabetic characters
-Any one of @code{a b c d e f g h i j k l m n o p q r s t u v w x y z}.
+@cindex lower-case letters
+Lower-case letters:
+@code{a b c d e f g h i j k l m n o p q r s t u v w x y z}.
@item [:print:]
@opindex print
@cindex printable characters
-Any character from the @samp{[:space:]} class, and any character that is
-@strong{not} in the @samp{[:graph:]} class.
+Printable characters:
+@samp{[:alnum:]}, @samp{[:punct:]}, and space.
@item [:punct:]
@opindex punct
@cindex punctuation characters
-Any one of @code{!@: " # $ % & ' ( ) * + , - .@: / : ; < = > ?@: @@ [ \ ] ^ _ ` @{ | @} ~}.
+Punctuation characters:
+@code{!@: " # $ % & ' ( ) * + , - .@: / : ; < = > ?@: @@ [ \ ] ^ _ ` @{ | @} ~}.
@item [:space:]
@opindex space
@cindex space characters
@cindex whitespace characters
-Any one of @code{CR FF HT NL VT SPACE}.
+Space characters:
+tab, newline, vertical tab, form feed, carriage return, and space.
@item [:upper:]
@opindex upper
-@cindex upper-case alphabetic characters
-Any one of @code{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}.
+@cindex upper-case letters
+Upper-case letters:
+@code{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}.
@item [:xdigit:]
@opindex xdigit
@cindex xdigit class
@cindex hexadecimal digits
-Any one of @code{a b c d e f A B C D E F 0 1 2 3 4 5 6 7 8 9}.
+Hexadecimal digits:
+@code{0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f}.
@end table
For example, @samp{[[:alnum:]]} means @samp{[0-9A-Za-z]}, except the latter
-form is dependent upon the @sc{ascii} character encoding, whereas the
-former is portable. (Note that the brackets in these class names are
+depends upon the @sc{posix} locale and the @sc{ascii} character
+encoding, whereas the former is independent of locale and character set.
+(Note that the brackets in these class names are
part of the symbolic names, and must be included in addition to
the brackets delimiting the bracket list.) Most metacharacters lose
their special meaning inside lists. To include a literal @samp{]}, place it
@@ -897,7 +918,9 @@ would probably generate output that is not useful, and it might even
muck up your display. So @sc{gnu} @command{grep} suppresses output from
files that appear to be binary files. To force @sc{gnu} @command{grep}
to output lines even from files that appear to be binary, use the
-@samp{-a} or @samp{--text} option.
+@samp{-a} or @samp{--binary-files=text} option. To eliminate the
+``Binary file matches'' messages, use the @samp{-I} or
+@samp{--binary-files=without-match} option.
@item
Why doesn't @samp{grep -lv} print nonmatching file names?
diff --git a/gnu/usr.bin/grep/doc/version.texi b/gnu/usr.bin/grep/doc/version.texi
index 2deace2..5246f40 100644
--- a/gnu/usr.bin/grep/doc/version.texi
+++ b/gnu/usr.bin/grep/doc/version.texi
@@ -1,3 +1,3 @@
-@set UPDATED 16 January 2000
-@set EDITION 2.4a
-@set VERSION 2.4a
+@set UPDATED 27 January 2000
+@set EDITION 2.4d
+@set VERSION 2.4d
diff --git a/gnu/usr.bin/grep/getopt1.c b/gnu/usr.bin/grep/getopt1.c
index a967c30..9c82565 100644
--- a/gnu/usr.bin/grep/getopt1.c
+++ b/gnu/usr.bin/grep/getopt1.c
@@ -1,37 +1,36 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987,88,89,90,91,92,93,94,96,97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
+ Free Software Foundation, Inc.
+ NOTE: The canonical source of this file is maintained with the GNU C Library.
+ Bugs can be reported to bug-glibc@gnu.org.
- This file is part of the GNU C Library. Its master source is NOT part of
- the C library, however. The master source lives in /gd/gnu/lib.
+ 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 the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
+ This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
-#include "getopt.h"
-
-#if !defined (__STDC__) || !__STDC__
+#else
+#if !defined __STDC__ || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
#define const
#endif
#endif
+#endif
+
+#include "getopt.h"
#include <stdio.h>
@@ -44,7 +43,7 @@
it is simpler to just do this in the source for each such file. */
#define GETOPT_INTERFACE_VERSION 2
-#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
+#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
#include <gnu-versions.h>
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
#define ELIDE_CODE
@@ -129,9 +128,9 @@ main (argc, argv)
switch (c)
{
case 0:
- printf (_("option %s"), long_options[option_index].name);
+ printf ("option %s", long_options[option_index].name);
if (optarg)
- printf (_(" with arg %s"), optarg);
+ printf (" with arg %s", optarg);
printf ("\n");
break;
@@ -146,38 +145,38 @@ main (argc, argv)
case '8':
case '9':
if (digit_optind != 0 && digit_optind != this_option_optind)
- printf (_("digits occur in two different argv-elements.\n"));
+ printf ("digits occur in two different argv-elements.\n");
digit_optind = this_option_optind;
- printf (_("option %c\n"), c);
+ printf ("option %c\n", c);
break;
case 'a':
- printf (_("option a\n"));
+ printf ("option a\n");
break;
case 'b':
- printf (_("option b\n"));
+ printf ("option b\n");
break;
case 'c':
- printf (_("option c with value `%s'\n"), optarg);
+ printf ("option c with value `%s'\n", optarg);
break;
case 'd':
- printf (_("option d with value `%s'\n"), optarg);
+ printf ("option d with value `%s'\n", optarg);
break;
case '?':
break;
default:
- printf (_("?? getopt returned character code 0%o ??\n"), c);
+ printf ("?? getopt returned character code 0%o ??\n", c);
}
}
if (optind < argc)
{
- printf (_("non-option ARGV-elements: "));
+ printf ("non-option ARGV-elements: ");
while (optind < argc)
printf ("%s ", argv[optind++]);
printf ("\n");
diff --git a/gnu/usr.bin/grep/savedir.c b/gnu/usr.bin/grep/savedir.c
index e329717..29b3842 100644
--- a/gnu/usr.bin/grep/savedir.c
+++ b/gnu/usr.bin/grep/savedir.c
@@ -76,9 +76,7 @@ char *stpcpy ();
Return NULL if DIR cannot be opened or if out of memory. */
char *
-savedir (dir, name_size)
- const char *dir;
- unsigned int name_size;
+savedir (const char *dir, off_t name_size)
{
DIR *dirp;
struct dirent *dp;
@@ -108,7 +106,7 @@ savedir (dir, name_size)
|| (dp->d_name[1] != '\0'
&& (dp->d_name[1] != '.' || dp->d_name[2] != '\0')))
{
- unsigned size_needed = (namep - name_space) + NAMLEN (dp) + 2;
+ off_t size_needed = (namep - name_space) + NAMLEN (dp) + 2;
if (size_needed > name_size)
{
diff --git a/gnu/usr.bin/grep/savedir.h b/gnu/usr.bin/grep/savedir.h
index 033e567..89be04d 100644
--- a/gnu/usr.bin/grep/savedir.h
+++ b/gnu/usr.bin/grep/savedir.h
@@ -10,6 +10,6 @@
# endif
char *
-savedir PARAMS ((const char *dir, unsigned int name_size));
+savedir PARAMS ((const char *dir, off_t name_size));
#endif
diff --git a/gnu/usr.bin/grep/stpcpy.c b/gnu/usr.bin/grep/stpcpy.c
index 380e65f..a01636c 100644
--- a/gnu/usr.bin/grep/stpcpy.c
+++ b/gnu/usr.bin/grep/stpcpy.c
@@ -34,9 +34,7 @@
/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */
char *
-__stpcpy (dest, src)
- char *dest;
- const char *src;
+__stpcpy (char *dest, const char *src)
{
register char *d = dest;
register const char *s = src;
OpenPOWER on IntegriCloud