]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - gnu/usr.bin/grep/ChangeLog
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / gnu / usr.bin / grep / ChangeLog
1 2002-03-26  Bernhard Rosenkraenzer <bero@redhat.com>
2         * src/grep.c: Don't fail if we don't have an stdout fd and -q
3           is used (happens e.g. on calls from hotplug scripts)
4         * src/grep.c: Don't hang forever if fed with an empty string to
5           grep for and --color enabled
6         * src/grep.c: Fix infinite loop on
7           echo "1 one" | grep -E "[0-9]*" -o
8           echo "1 one" | grep -E "[0-9]*" --color
9         * po/*: Sync wiith translation project
10         * src/grep.c, src/Makefile.am, configure.in: Add patch from
11           Paul Eggert <eggert@twinsun.com> to comply with ridiculous
12           guidelines (don't act differently if invoked as egrep or fgrep)
13         * configure.in: Bump version number, require a recent autoconf
14
15 2002-03-14  Bernhard Rosenkraenzer <bero@redhat.com>
16         * src/Makefile.am, po/Makefile.in.in: Support DESTDIR properly
17         * tests/bre.tests: Add fix from
18           Peter Breitenlohner <peb@mppmu.mpg.de>
19
20 2002-03-13  Bernhard Rosenkraenzer <bero@redhat.com>
21         * configure.in, m4/regex.m4, m4/malloc.m4, m4/realloc.m4:
22           Don't set LIBOBJS directly, autoconf 2.53 doesn't like it
23         * intl/*: Sync with gettext 0.11
24         * po/*: Sync with translation project
25         * configure.in, src/Makefile.am: Don't duplicate code - make
26           egrep and fgrep links to grep and set matcher based on
27           application name, suggestion from
28           Guillaume Cottenceau <gc@mandrakesoft.com>
29         * src/grep.c: (prline) Add fix for -i --color from
30           Jim Meyering <meyering@lucent.com>
31         * configure.in: Version 2.5; release
32
33 2002-01-23  Bernhard Rosenkraenzer <bero@redhat.com>
34         * configure.in: Version 2.5g
35         * Makefile.cvs, grep.spec: Add packaging tools
36         Merge djgpp changes from Andrew Cottrell <anddjgpp@ihug.coml.au>:
37         * src/grep.c: Added conditional compilation for DJGPP
38         * djgpp: remove directory as it is no longer required with DJGPP 2.03
39                  (or 2.04 when released)
40         * README.DOS: Moved djgpp/readme to readme.dos
41         * PATCHES.AC, PATCHES.AM: delete files - redundant
42         * configure.in, Makefile.am: remove djgpp directory from list
43
44 2002-01-22  Bernhard Rosenkraenzer <bero@redhat.com>
45         * doc/grep.texi, doc/grep.1, NEWS: Document --label
46         * po/ru.po: Sync with translation project
47         * po/grep.pot: Sync with source
48
49 2002-01-18  Bernhard Rosenkraenzer <bero@redhat.com>
50         * src/grep.c: Add --label, based on patch from Stepan Koltsov
51
52 2001-11-20  Bernhard Rosenkraenzer <bero@redhat.com>
53         * autogen.sh: Don't hardcode aclocal dir
54
55 2001-11-19  Bernhard Rosenkraenzer <bero@redhat.com>
56         * src/grep.c: Add --only-matching (-o) switch (see NEWS)
57         * doc/grep.texi, doc/grep.1, NEWS: Document changes
58         * configure.in, lib/Makefile.am: Don't use internal getopt if
59           we're on a system that provides a working getopt function
60
61 2001-09-25  Bernhard Rosenkraenzer <bero@redhat.com>
62         * configure.in: Detect pcre correctly even when it's in
63           non-standard locations, using pcre-config
64         * src/grep.c: Add --color={always,never,tty} argument (like in ls)
65         * src/grep.c: Turn off blinking in the default colorization
66         * src/grep.c: Add --devices (-D) switch (analogous to --directories)
67         * src/dfa.c: Fix an i18n bug: echo "A" | grep '[A-Z0-9]' wouldn't work
68           in non-C-Locales on systems using current versions of glibc.
69         * AUTHORS: Change maintainer, credit Alain for his work until now
70         * configure.in, m4/decl.m4, m4/dosfile.m4, m4/gettext.m4,
71           m4/init.m4, m4/install.m4, m4/largefile.m4, m4/lcmessage.m4,
72           m4/header.m4, m4/isc-posix.m4, m4/missing.m4, m4/progtest.m4,
73           m4/sanity.m4:
74           Fix build with autoconf 2.5x, retain 2.1x compatibility for now
75         * autogen.sh: Add some crude hacks to make it possible to build with
76           both autoconf 2.5x and 2.1x
77         * acconfig.h: removed (no longer required)
78         * Makefile.am: add cvs-clean target
79         * doc/grep.texi, doc/grep.1, NEWS: Document changes
80           (--color, --devices, -D)
81         * src/dfa.c, src/grep.c: Add vim modelines
82
83 2001-08-30  Alain Magloire
84
85         * configure.in: Add gl in ALL_LINGUAS.
86
87 2001-08-30  Kurt D Schwehr
88
89         * doc/grep.1: Warn that grep insert a "--" between groups of matches,
90         when using the context options.
91         * doc/grep.texi: Likewised.
92
93 2001-08-25  Heikki Korpela
94
95         * doc/grep.texi: Point out that some Platforms do not support
96         reading of directories and silently ignore them.
97
98 2001-08-21  Alain Magloire
99
100         * lib/malloc.c: New file:
101         * lib/realloc.c: New file:
102         * lib/Makefile.am: Add malloc.c and realloc.c in EXTRA_DIST.
103
104 2001-07-31  Alain Magloire
105
106         * po/*.po: New files from the translation team:
107         grep-2.5e.de.po  grep-2.5e.el.po  grep-2.5e.eo.po grep-2.5e.es.po
108         grep-2.5e.et.po  grep-2.5e.fr.po  grep-2.5e.gl.po grep-2.5e.it.po
109         grep-2.5e.pl.po  grep-2.5e.sl.po
110
111 2001-07-31  Andreas Schwab
112
113         * src/grep.c: Fix all uses of error to pass a proper format
114         string.
115
116 2001-07-29  Alain Magloire
117
118         * grep/src/grep.c (usage): Typos corrected.
119         Patches from Santiago Vila.
120
121 2001-07-29  Alain Magloire
122
123         David Clissold, wrote:
124         a small bug in the GNU grep 2.4.2, which may have gone unnoticed
125         because it only causes a failure if building on a system with large
126         files enabled (e.g. an "off_t" is a "long long" rather than a "long").
127         savedir() takes on off_t argument, but in grepdir() the parameter
128         is cast to an (unsigned).  Well, if an off_t is larger than an int,
129         the value gets truncated.  This would not normally have an effect on a
130         little-endian platform (unless the file is >2GB), but on a big-endian
131         system it will always fail.  The external effect is that
132         "grep -r foo dir_name" fails with ENOMEM (from malloc() within
133         savedir()).
134
135         * grep/src/grep.c (grepdir): Remove the (unsigned) cast when calling
136         savedir().
137         Patch from David Clissold.
138
139 2001-07-29  Alain Magloire
140
141         * grep/doc/grep.texi: In Bugs report use {n,m} for consistency.
142         * grep/doc/grep.1: Likewised.
143         Noted by Steven Lucy.
144
145 2001-04-27  Isamu Hasegawa
146
147         * dfa.c (mblen_buf) : New variable contains the amount of remain
148         byte of corresponding multibyte character in the input string.
149         (SKIP_REMAIN_MB_IF_INITIAL_STATE) : Use mblen_buf.
150         (match_anychar) : Use mblen_buf.
151         (match_mb_charset) : Use mblen_buf.
152         (transit_state_consume_1char) : Use mblen_buf.
153         (transit_state) : Use inputwcs to get current (multibyte) character.
154         (dfaexec) : Add initialization of mblen_buf.
155
156 2001-04-27  Isamu Hasegawa
157
158         * dfa.c (addtok) : Set appropriate value to multibyte_prop.
159         (dfastate) : Add the initialization of the variable.
160         (dfaexec) : Call transit_state if d->fail may transit by
161         multibyte characters.
162         (transit_state_singlebyte) : Clean up unnecessary code.
163         (transit_state_consume_1char) : Likewise.
164         (transit_state) : Add checking for word and newline.
165
166 2001-04-19  Isamu Hasegawa
167
168         * search.c (check_multibyte_string) : Check the case when mbclen == 0.
169
170 2001-04-11  Isamu Hasegawa
171
172         * search.c (check_multibyte_string) : Check the head of multibyte
173         characters, and optimize a bit.
174         (EGexecute) : Optimize a bit.
175         (Fexecute) : Fix the index.
176
177 2001-04-02  Alain Magloire
178
179         * lib/regex.c: Update from GNU lib C, with the changes
180         provided by Paul Eggert.
181         * lib/posix/regex.h: Likewise.
182
183 2001-02-17  Paul Eggert
184
185         Stop trying to support hosts that have nonstandard declarations for
186         mbrtowc and/or mbstate_t.  It's not worth the portability hassle.
187
188         * lib/quotearg.c (mbrtowc, mbsinit): Remove workaround macros
189         for hosts that have mbrtowc but not mbstate_t, as we now
190         insist on proper declarations for both before using mbrtowc.
191
192 2001-03-18  Alain Magloire
193
194         * configure.in: Call AC_MBSTATE_T.
195         * Makefile.am: Add mbstate_t.m4
196         * m4/Makefile.am: Add mbstate_t.m4
197         * m4/mbstate_t.m4: New m4 macro.
198         * lib/strtol.c: Define CHAR_BITS.
199         Uwe H. Steinfeld, Ruslan Ermilov, Volkert Bochert, noted
200         that mbstate_t was not define for certain platforms.
201
202 2001-03-18  Paul Eggert
203
204         * src/grep.c (fillbuf): Fix storage allocation performance
205         bug: buffer was doubling in size in many cases where it didn't
206         have to.
207
208 2001-03-17  Paul Eggert
209
210         * src/grep.c (fillbuf): Avoid unnecessary division by 2.
211         Don't check xrealloc return value; it's guaranteed to be nonzero.
212         (fillbuf, grepdir): Use xalloc_die rather than error; it's shorter.
213
214 2001-03-17  Alain Magloire
215
216         * src/grep.c (context_length_arg): error () passing wrong format.
217         Spotted by Jim Meyering.
218
219 2001-03-07  Alain Magloire
220
221         * README-alpha: Removed reference to GNU tar, add the location
222         of the CVSROOT.
223
224 2001-03-06  Alain Magloire
225
226         Only the Regex patterns should be split in an array, patterns[].
227         The dfa and KWset compiled patterns should remain global and the
228         patterns compiled all at once.
229
230         * src/search.c: include "error.h" and "xalloc.h" to get prototyping
231         of x*alloc() and error().
232         (kwsinit): Reverse to previous behaviour and takes no argument.
233         (kwsmusts): Likewised.
234         (Gcompile): For the regex pattern, split them and each pattern
235         is put in different compiled structure patterns[]. The patterns
236         are given to dfacomp() and kwsmusts() as is.
237         (Ecompile): Likewised.
238         (Fcompile): Reverse to the old behaviour of compiling the enire
239         patterns in one shot.
240         (EGexecute): If falling to GNU regex for the matching, loop in the
241         array of compile patterns[] to find a match.
242         (error): Many error () were call with arguments in the wrong order.
243         * tests/file.sh: Simple test to check for pattern in files.
244
245         Reaction to bug report fired by Greg Louis <glouis@dynamicro.on.ca>
246
247 2001-03-06  Isamu Hasegawa
248
249         In multibyte environments, handle multibyte characters as single
250         characters in bracket expressions.
251
252         * src/dfa.h (mb_char_classes) : new structure.
253         (mbcsets): new variable.
254         (nmbcsets): new variable.
255         (mbcsets_alloc) : new variable.
256         * src/dfa.c (prtok) : handle MBCSET.
257         (fetch_wc): new function to fetch a wide character.
258         (parse_bracket_exp_mb) : new function to handle multibyte character
259         in lex().
260         (lex): invoke parse_bracket_exp_mb() for multibyte bracket expression.
261         (atom): handle MBCSET.
262         (epsclosure): likewise.
263         (dfaanalyze): likewise.
264         (dfastate): likewise.
265         (match_mb_charset): new function to judge whether a bracket match
266         with a multibyte character.
267         (check_matching_with_multibyte_ops) : handle MBCSET.
268         (dfainit): initialize new variables.
269         (dfafree): free new variables.
270
271 2001-03-04  Alain Magloire
272
273         To get more in sync with other GNU utilities like GNU tar and fetish
274         all the supporting functions are now under lib.
275         Thanks to Jim Meyering, Volkert Bochert and Paul Eggert for
276         the code and the reminders.
277
278         * src/grep.c (fatal): Function removed, using error () from
279         lib/error.c instead.
280         (usage): Copyright updated.
281         (error): Function removed, using error () from lib/error.c instead,
282         adjust prototypes.
283         (prog): Global variable rename to program_name, to work with new
284         lib/error.c.
285         (xrealloc): Removed using lib/xmalloc.c.
286         (xmalloc): Removed using lib/xmalloc.c
287         (main): Register with atexit() to check for error on stdout.
288         * configure.in: Check for atexit(), call jm_MALLOC, jm_RELLOC and
289         jm_PREREQ_ERROR.
290         * tests/bre.awk: Removed the hack to drain the buffer since we
291         always fclose(stdout) atexit.
292         * tests/ere.awk: Likewise.
293         * tests/spencer1.awk: Likewise.
294         * bootstrap/Makefile.try: Update the Makefile to reflect the changes
295         in the new hierarchy.
296
297         * README-alpha: New File.
298         * m4/realloc.m4: New File.
299         * m4/malloc.m4: New File.
300         * m4/error.m4: New File.
301         * m4/Makefile.am: Updated.
302         * lib: New directory.
303         * lib/Makefile.am: New file.
304         * lib/closeout.c: New file.
305         * lib/closeout.h: New file.
306         * lib/fnmatch.c: New file.
307         * lib/fnmatch.h: New file.
308         * lib/atexit.c: New file.
309         * lib/error.c: New file.
310         * lib/error.h: New file.
311         * lib/quotearg.h: New file.
312         * lib/quotearg.c: New file.
313         * lib/xmalloc.c: New file.
314         * lib/posix: New directory.
315         * lib/posix/Makefile.am: New file.
316         * src/getopt.c: Moved to lib.
317         * src/getopt1.c: Moved to lib.
318         * src/getopt.h: Moved to lib.
319         * src/alloca.c: Moved to lib.
320         * src/exclude.c: Moved to lib.
321         * src/exclude.h: Moved to lib.
322         * src/hard-locale.h: Moved to lib.
323         * src/hard-locale.c: Moved to lib.
324         * src/isdir.c: Moved to lib.
325         * src/mechr.c: Moved to lib.
326         * src/obstack.c: Moved to lib.
327         * src/obstack.h: Moved to lib.
328         * src/regex.c: Moved to lib.
329         * src/regex.h: Moved to lib.
330         * src/posix: Moved to lib.
331         * src/posix/regex.h: Moved to lib.
332         * src/savedir.h: Moved to lib.
333         * src/savedir.c: Moved to lib.
334         * src/stpcpy.c: Moved to lib.
335         * src/strtoul.c: Moved to lib.
336         * src/strtol.c: Moved to lib.
337         * src/strtoull.c: Moved to lib.
338         * src/strtoumax.c: Moved to lib.
339         * src/xstrtol.c: Moved to lib.
340         * src/xstrtol.h: Moved to lib.
341         * src/xstrtoumax.c: Moved to lib.
342
343 2001-03-01  Isamu Hasegawa
344
345         Implement the mechanism to match with multibyte characters,
346         and use it for `period' in multibyte environments.
347
348         * dfa.h (mbps): new variable.
349         * dfa.c (prtok): handle ANYCHAR.
350         (lex): use ANYCHAR for `period' in multibyte environments.
351         (atom): handle ANYCHAR.
352         (state_index): initialize mbps in multibyte environments.
353         (epsclosure): handle ANYCHAR.
354         (dfaanalyze): handle ANYCHAR.
355         (dfastate): handle ANYCHAR.
356         (realloc_trans_if_necessary): new function.
357         (transit_state_singlebyte): new function.
358         (match_anychar): new function.
359         (check_matching_with_multibyte_ops): new function.
360         (transit_state_consume_1char): new function.
361         (transit_state): new function.
362         (dfaexec): invoke transit_state if expression can match with
363         a multibyte character in multibyte environments.
364         (dfamust): handle ANYCHAR.
365
366 2001-03-01  Alain Magloire
367
368         * src/exclude.c: New file.
369         * src/exclude.h: New file.
370         * src/grep.c (main): Took the GNU tar code to handle
371         the option --include, --exclude, --exclude-from.
372         Files are check for a match, with exlude_filename ().
373         New option --exclude-from.
374         * src/savedir.c: Call exclude_filename() to check for
375         file pattern exclusion or inclusion.
376         * configure.in: --disable-pcre rename to --disable-perl-regexp.
377
378
379 2001-02-25  Alain Magloire
380
381         * src/dfa.c: Typo corrected.
382         Noted by Isamu Hasegawa.
383         * src/savedir.c: Typos corrected.
384
385 2001-02-22  Alain Magloire
386
387         * src/savedir.c (isdir1): New function, calling isdir with
388         the correct pathname.
389
390 2001-02-19  Isamu Hasegawa
391
392         Avoid incorrect state transition in multibyte environments.
393
394         * dfa.h (nmultibyte_prop): new variable.
395         (multibyte_prop): new variable.
396         * dfa.c (addtok): set inputwcs.
397         (dfastate): avoid incorrect state transition in multibyte
398         environments.
399         (dfaexec): likewise.
400         (dfainit): init multibyte_prop.
401         (dfafree): free multibyte_prop.
402         (inputwcs): new variable.
403
404 2001-02-19  Isamu Hasegawa
405
406         Handle a multibyte character followed by '*', '+', and '{n,m}'
407         correctly.
408
409         * dfa.c (update_mb_len_index): new function.
410         Support for multibyte string.
411         (FETCH): call update_mb_len_index.
412         (lex): check cur_mb_index not to misunderstand multibyte characters.
413         (atom): make a tree from a multibyte character.
414         (dfaparse): initialize new variables.
415         (mbs): new variable.
416         (cur_mb_len): new variable.
417         (cur_mb_index): new variable.
418
419 2001-02-18  Jim Meyering
420
421         * m4/dosfile.m4 (AC_DOSFILE): Move AC_DEFINEs out of AC_CACHE_CHECK.
422
423 2001-02-17  Alain Malgoire
424
425         * doc/grep.texi: Document the new options and the new behaviour
426         back-references are local.  Use excerpt from Karl Berry regex
427         texinfo.
428
429         * bootstrap/Makefile.try: Added xstrtoumax.o xstrtoul.o hard-local.o
430
431 2001-02-17  Alain Magloire
432
433         From Guglielmo 'bond' Bondioni :
434         The bug was that using a multi line file that contained REs (one per
435         line), backreferences in the REs were considered global (to the file)
436         and not local (to the line).
437         That is, \1 in line n refers to the first \(.\) in the whole file,
438         rather than in the line itself.
439
440         From Tapani Tarvainen :
441         # Re: grep -e '\(a\)\1' -e '\(b\)\1'
442         That's not the way it should work: multiple -e arguments
443         should be treated as independent patterns and back references
444         should not refer to previous ones.
445
446         From Paul Eggert :
447         GNU grep currently does not issue
448         diagnostics for the following two cases, both of which are erroneous:
449         grep -e '[' -e ']'
450         grep '[
451         ]'
452         POSIX requires a diagnostic in both cases because '[' is not a valid
453         regular expression.
454
455         To overcome those problems, grep no longer pass the concatenate
456         patterns to GNU regex but rather compile each patterns separately
457         and keep the result in an array.
458
459         * src/search.c (patterns): New global variable; a structure array
460         holding the compiled patterns.
461         Declare function prototypes to minimize error.
462         (dfa, kswset, regexbuf, regs): Removed, no longer static globals, but
463         rather fields in patterns[] structure per motif.
464         (Fcompile): Alloc an entry in patterns[] to hold the regex.
465         (Ecompile): Alloc an entry per motif in the patterns[] array.
466         (Gcompile): Likewise.
467         (EGexecute): Loop through of array of patterns[] for a match.
468
469 2001-02-17  Alain Magloire
470
471         From Bernd Strieder :
472         # tail -f logfile | grep important | do_something_urgent
473         # tail -f logfile | grep important | do_something_taking_very_long
474         If grep does full buffering in these cases then the urgent operation
475         does not happen as it should in the first case, and in the second case
476         time is lost due to waiting for the buffer to be filled.
477         This is clearly spoken not grep's fault in the first place, but libc's.
478         There is a heuristic in libc that make a stream line-buffered only if a
479         terminal is on the other end. This doesn't take care of the cases where
480         this connection is somehow indirect.
481
482         * src/grep.c (line_buffered): new option variable.
483         (prline): if line_buffered is set fflush() is call.
484         (usage): line_buffered new option.
485         Input from Paul Eggert, doing setvbuf() may not be portable
486         and breaks grep -z.
487
488 2001-02-16  Alain Magloire
489
490         Patch from Isamu Hasegawa, for multibyte support.
491         This patch prevent kwset_matcher from following problems.
492         For example, in SJIS encoding, one character has the codepoint 0x895c.
493         So the second byte of the character can match with '\' incorrectly.
494         And in eucJP encoding, there are the characters whose codepoints are
495         0xa5b9, 0xa5c8.  On the other hand, there is one character whose
496         codepoint is 0xb9a5.  So 0xb9a5 can match with 2nd byte of 0xa5b9
497         and 1st byte of 0xa5c8.
498
499         * configure.in: Add check for mbrtowc.
500         * src/search.c (check_multibyte_string): new function.
501         Support for multibyte string.
502         (EGexecute): call check_multibyte_string when kwset is set.
503         (Fexecute): call to check_multibyte_string.
504         (MBS_SUPPORT): new macro.
505         (MB_CUR_MAX): new macro.
506
507 2001-02-16  Alain Magloire
508
509         * djgpp/config.bat: Fix for 4dos.com.
510         * m4/dosfile.m4 (HAVE_DOS_FILE_CONTENTS): Was not set.
511         Bugs noted and patched by Juan Manuel Guerrero.
512
513 2001-02-16  Alain Magloire
514
515         A much requested feature, the possibility to select
516         files when doing recurse :
517         # find . -name "*.c" | xargs grep main {}
518         # grep --include=*.c main .
519         # find . -not -name "*.c" | xargs grep main {}
520         # grep --exclude=*.c main .
521
522         * src/grep.c (short_options): -R equivalent to -r.
523         (#ifdef) : Fix some inconsistencies in the use of #ifdefs, prefer
524         #if defined() wen possible.
525         (long_options): Add --color, --include and exclude.
526         (Usage): Description of new options.
527         (color): Rename color variable to color_option.
528         Removed 'always|never|auto' arguments, not necessary for grep.
529         (exclude_pattern): new variable, holder for the file pattern.
530         (include_pattern): new variable, hoder for the file pattern.
531         * src/savedir.c: Signature change, take two new argmuments.
532         * doc/grep.texi: Document, new options.
533         * doc/grep.man: Document, new options.
534
535 2001-02-09  Alain Magloire
536
537         * src/grep.c (long_options): Added equivalent to -r with -R.
538         * src/grep.c (usage): added --color and --colour.
539         Noted with patch from, H.Merijn Brand and Wichert Akkerman.
540
541 2001-02-09  Alain Magloire
542
543         Patch from Ulrich Drepper to provide hilighting.
544
545         * src/grep.c: New option --color.
546         (color): New static var.
547         (COLOR_OPTION): new constant.
548         (grep_color): new static var.
549         (prline): Now when color is set prline() will call the current matcher
550         to find the offset of the matching string.
551         * src/savedir.c: Take advantage of _DIRENT_HAVE_TYPE if supported.
552         * src/search.c (EGexecute, Fexecute, Pexecute): Take a new argument
553         when doing exact match for the color hiligting.
554
555 2000-09-01  Brian Youmans
556
557         * doc/grep.texi: Typo fixes.
558
559 2000-08-30  Paul Eggert
560
561         * doc/grep.texi (Usage): Talk about what "grep -r hello *.c"
562         means.
563
564 2000-08-20  Paul Eggert
565
566         Handle range expressions correctly even when they match
567         strings with two or more characters.
568
569         * src/dfa.h (CRANGE): New enum value.  Comment fix.
570
571         * src/dfa.c: Include <locale.h> if HAVE_SETLOCALE.
572         Include "hard-locale.h".
573         (prtok): Print CRANGE.
574         (hard_LC_COLLATE): New static var.
575         (lex): Return CRANGE when parsing a character range in a hard locale.
576         Don't use strcoll; it's no longer needed and wasn't correct anyway.
577         Use unsigned rather than token to hold unsigned chars.
578         (addtok): Comment fix.
579         (atom): Treat a CRANGE as if it were (.\1), approximately.
580         (dfaparse): Initialize hard_LC_COLLATE.
581
582         * src/Makefile.am (base_sources): Add hard-locale.c, hard-locale.h.
583
584         * src/hard-locale.c, src/hard-locale.h: New files, taken from
585         textutils.
586
587 2000-08-20  Paul Eggert
588
589         * tests/Makefile.am (TESTS_ENVIRONMENT): Add LC_ALL=C, since
590         some of the tests assume the C locale.
591
592 2000-08-16  Paul Eggert
593
594         * src/search.c (Gcompile, Ecompile): -x overrides -w, for
595         consistency with fgrep.  Don't assume that sizes fit in 'int'.
596         Fix comments to match code.
597
598 2000-06-06  Paul Eggert
599
600         * src/grep.c (grepdir): Don't look at st_dev when testing for
601         Mingw32 bug.
602
603 2000-06-05  Paul Eggert
604
605         Port to Mingw32, based on suggestions from Christian Groessler
606         <cpg@aladdin.de>.
607
608         * src/isdir.c: New file, taken from fileutils.
609
610         * src/Makefile.am (base_sources): Add isdir.c.
611
612         * src/grep.c (grepfile): Use isdir instead of doing it inline.
613         (grepdir): Suppress ancestor check if the directory's inode and device
614         are both zero, as that occurs only on Mingw32 which doesn't support
615         inode or device.
616
617         * src/system.h (isdir): New decl.
618         (is_EISDIR): Depend on HAVE_DIR_EACCES_BUG, not D_OK.
619         Use isdir, not access.
620
621 2000-06-02  Paul Eggert
622
623         Problen noted by Gerald Stoller <gerald_stoller@hotmail.com>
624
625         * src/grep.c (main): POSIX.2 says that -q overrides -l, which
626         in turn overrides the other output options.  Fix grep to
627         behave that way.
628
629 2000-05-27  Paul Eggert
630
631         Simplify and tune the buffer allocation strategy.  Do not reserve a
632         large save area: reserve only enough bytes to hold the residue, plus
633         page alignment.  Put a newline sentinel before the buffer, for speed
634         when searching backwards for newline.
635
636         * src/grep.c (ubuffer, bufsalloc, PREFERRED_SAVE_FACTOR, page_alloc):
637         Remove.  All uses changed.
638         (INITIAL_BUFSIZE): New macro.
639         (reset, fillbuf): Use simpler buffer allocation strategy.
640         (reset): Check for preposterously large pagesize that would cause
641         later calculations to overflow.
642         (fillbuf): Do not resize buffer if there's room at the end for
643         at least one more page.  This greatly increases performance when
644         reading from non-regular files that contain no newlines.
645         When growing the buffer, double its size instead of using a
646         more complicated algorithm.
647         (prtext, grep): Speed up by relying on the newline sentinel before the
648         start of the buffer.
649         (grep): When looking backwards for the last newline in a buffer,
650         stop when we hit the residue, since it can't contain a newline.
651         This avoids an O(N**2) algorithm when reading binary data from
652         a pipe.  Use a sentinel to speed up the backward search for newline.
653         (nlscan): Undo previous change; it wasn't needed and just complicates
654         and slows down the code a tad.
655
656 2000-05-24  Paul Eggert
657
658         Handle very large input counts better. Bug noted by Jim Meyering.
659
660         * src/grep.c (totalcc, totalnl): Use uintmax_t, not off_t.
661         (add_count): New function.
662         (nlscan, prline, grep): Use it to check line and byte count overflows.
663         (nlscan, grep): Don't keep track of counts when not asked to; this
664         avoids unnecessary overflow diagnostics.
665         (print_offset_sep): Now takes args of type uintmax_t and char,
666         not off_t and int.
667
668 2000-05-16  Paul Eggert
669
670         Problem reported by Bob Proulx <rwp@hprwp.fc.hp.com>, this patch
671         is base on his finding, with appropiate corrections.
672
673         * src/grep.c (main): Fix bug: -x and -w matched even when no
674         patterns were specified.
675         * tests/empty.sh: Test for -x and -w bug in grep 2.4.2.
676
677 2000-04-24  Paul Eggert
678
679         POSIX.2 conformance fixes: grep -q now exits with status zero
680         if an input line is selected, even if an error also occurs.
681         grep -s no longer affects exit status.
682
683         * src/grep.c (suppress_errors): Move definition earlier so
684         that suppressible_error can use it.
685         (suppressible_error): New function.
686         (exit_on_match): New var.
687         (grepbuf): If exit_on_match is nonzero, exit with status zero
688         immediately.
689         (grep, grepfile, grepdir): Invoke suppressible_error.
690         (main): -q sets exit_on_match.
691
692         * doc/grep.1, doc/grep.texi, NEWS:
693         Document -q's behavior as required by POSIX.2.
694
695         * tests/status.sh:
696         Test for -q and -s behavior as conforming to POSIX.2.
697
698 2000-04-20  Paul Eggert
699
700         * tests/Makefile.am (TESTS_ENVIRONMENT):
701         Set GREP_OPTIONS to the empty string.
702
703 2000-04-20  Paul Eggert
704
705         * tests/status.sh: Fix typo: test -b -> test -r.
706
707 2000-04-20  Paul Eggert
708
709         * src/dfa.c (lex):
710         Do not assume that [c] is equivalent to [c-c]; this isn't true
711         if LC_COLLATE specifies that some characters are equivalent.
712         (setbit_case_fold): New function.
713         (lex): Use it to simplify the code a bit.
714
715 2000-04-17  Paul Eggert
716
717         Do CRLF munging only if HAVE_DOS_FILE_CONTENTS, instead of
718         having it depend on O_BINARY (which leads to incorrect results
719         on BeOS, VMS, and MacOS).
720
721         * bootstrap/Makefile.try (DEFS): Add -DHAVE_DOS_FILE_CONTENTS.
722         * src/system.h (SET_BINARY): Define only if HAVE_DOS_FILE_CONTENTS.
723         (O_BINARY): Do not define.
724
725         * m4/dosfile.m4: Define HAVE_DOS_FILE_CONTENTS if it appears we're
726         using DOS.
727
728         * src/grep.c (undossify_input, fillbuf, dosbuf.c, prline, main):
729         Depend on HAVE_DOS_FILE_CONTENTS, not O_BINARY, when handling CRLF
730         matters.
731         (grepfile, main): Depend on SET_BINARY, not O_BINARY, when
732         handling binary files on hosts that care about text versus binary.
733
734 2000-04-17  Paul Eggert
735
736         * lib/getpagesize.h (getpagesize): Define to B_PAGE_SIZE if
737         __BEOS__ is defined.  Based on a fix by Bruno Haible
738         <haible@clisp.cons.org>.
739
740 2000-04-17  Bruno Haible
741
742         * src/system.h [BeOS]: Ignore O_BINARY.
743         * src/getpagesize.h [BeOS]: Define getpagesize() as B_PAGE_SIZE.
744
745 2000-04-10  Paul Eggert
746
747         * doc/grep.1, doc/grep.texi, NEWS: -C now requires an operand.
748         * src/grep.c (short_options, long_options, main, usage): Likewise.
749         (context_length_arg): Renamed from ck_atoi.  Now reports an error
750         and exits if the number is out of range for a context length.
751         (get_nondigit_option): New function, which checks for overflow
752         correctly, and which does not parse nonadjacent strings of digits
753         into a single number.
754         (main): Use get_nondigit_option instead of doing the code inline.
755         With -A, -B, and -C, optarg is now guaranteed to be nonzero.
756
757 2000-04-08  Paul Eggert
758
759         Now that we know that the input is always terminated by a
760         newline before the matching algorithms see it, clean up the
761         matching algorithms so that they no longer need to modify the
762         input by inserting a sentinel newline, and no longer worry
763         about running off the end of the buffer due to a missing sentinel.
764
765         * src/grep.c (nlscan, prpending, prtext, grepbuf): Do not
766         worry about running off the end of the input buffer, since
767         it's now guaranteed to end in the sentinel newline.
768         * src/search.c (EGexecute, Pexecute): Likewise.
769
770         * src/dfa.c (prtok, dfasyntax, dfaparse, copy, merge, state_index,
771         epsclosure, dfaexec, dfacomp):
772         Change many instances of "T *" to "T const *", to catch
773         any inadvertent programming errors made during this conversion.
774         * src/dfa.h (dfacomp, dfaexec, dfaparse): Likewise.
775         * src/grep.c (struct stats.parent, long_options, grepdir,
776         compile, execute, fillbuf, lastnl, lastout, nlscan, prline,
777         prpending, prtext, grepbuf, grep, grepfile, grepdir): Likewise.
778         * src/grep.h (struct matcher.compile, struct matcher.execute):
779         Likewise.
780         * src/kwset.c (struct kwset.trans, kwsalloc, kwsincr, treefails,
781         treedelta, hasevery, treenext, bmexec, cwexec, kwsexec): Likewise.
782         * src/kwset.h (kwsalloc, kwsincr, kwsexec): Likewise.
783         * src/search.c (kwsmusts, Gcompile, Ecompile, EGexecute, Pcompile,
784         Pexecute): Likewise.
785
786         * src/dfa.c (dfaexec):
787         Use size_t, not char *, to avoid worrisome casts to convert
788         char const * to char *.
789         * src/dfa.h (dfaexec): Likewise.
790         * src/grep.c (execute): Likewise.
791         * src/grep.h (execute): Likewise.
792         * src/kwset.c (bmexec, cwexec, kwsexec): Likewise.
793         * src/kwset.h (struct kwsmatch.offset, kwsalloc, kwsincr,
794         kwsexec): Likewise.
795         * src/search.c (EGexecute, Fexecute, Pexecute): Likewise.
796
797         * src/dfa.h (_PTR_T): Depend on defined __STDC__, not __STDC__.
798         (PARAMS): Depend on PROTOTYPES, not __STDC__.
799
800         * src/dfa.c (dfasyntax): Last arg is unsigned char, not int.
801         * src/dfa.h (dfasyntax): Likewise.
802
803         * src/dfa.h (struct dfa): Remove member newlines; no longer needed.
804         * src/dfa.c (build_state, dfaexec, dfafree): Do not worry
805         about special newline state.
806
807         * src/search.c (matchers): Move definition to end of file, so
808         that we don't need forward decls.
809         (lastexact): Remove.
810         (kwset_exact_matches): New var; subsumes old lastexact var.
811         All uses changed.
812
813         * src/dfa.c (index): Remove macro.
814         (REALLOC_IF_NECESSARY): Skip unnecessary test.
815         (tstbit, setbit, clrbit): Declare arg to be unsigned, to help compiler.
816         (copyset, zeroset, equal): Use C builtin primitives, to help compiler.
817         (dfaexec): Do not modify input string.
818         Remove newline parameter; no longer needed.
819         (comsubs): Use strchr, not index.
820
821         * src/grep.h (matchers): Use fixed name size, not pointer (as
822         there's no need for the extra flexibility).  All uses changed.
823
824         * src/kwset.h (struct kwsmatch.offset): Renamed from beg, with
825         change of type to size_t.  All uses changed.
826
827         * src/grep.c (reset): No longer need kludge for dfaexec.  Simplify.
828         (reset, grepbuf): Adjust to new interface for 'execute'.
829         (install_matcher): List is now terminated by null compile,
830         not null name.
831         Do not invoke setrlimit if that wouldn't change the limit.
832
833         * src/dfa.c (xcalloc, xmalloc, xrealloc, prtok, tstbit, setbit,
834         clrbit, copyset, zeroset, notset, equal, charclass_index,
835         looking_at, lex, addtok, atom, nsubtoks, copytoks, closure,
836         branch, regexp, copy, insert, merge, delete, state_index,
837         build_state, build_state_zero, icatalloc, icpyalloc, istrstr,
838         ifree, freelist, enlist, comsubs, addlists, inboth):
839         Remove forward decls; no longer needed.
840         * src/grep.c (ck_atoi, usage, error, setmatcher,
841         install_matcher, prepend_args, prepend_default_options,
842         page_alloc, reset, fillbuf, grepbuf, prtext, prpending, prline,
843         print_offset_sep, nlscan, grep, grepfile): Likewise.
844         * src/kwset.c (enqueue, treefails, treedelta, hasevery,
845         treenext, bmexec, cwexec): Likewise.
846         * src/search.c (Gcompile, Ecompile, EGexecute, Fcompile, Fexecute,
847         Pcompile, Pexecute, kwsinit): Likewise.
848
849         * src/search.c (Pcompile): Do not assume newly allocated
850         storage is zeroed.
851
852 2000-04-06  Paul Eggert
853
854         * doc/grep.1, doc/grep.texi, NEWS: Improve the explanation of
855         locale-dependent behavior of range expressions.  Mention
856         LC_COLLATE, since this affects range expressions.
857
858 2000-03-26  Paul Eggert
859
860         * Makefile.am (ACINCLUDE_INPUTS): Add decl.m4, inttypes_h.m4,
861         uintmax_t.m4, ulonglong.m4, xstrtoumax.m4.
862         * m4/Makefile.am (EXTRA_DIST): Likewise.
863
864         * src/Makefile.am (base_sources):
865         Add xstrtol.c, xstrtol.h, xstrtoumax.c.
866         (EXTRA_DIST): Add strtol.c.
867
868         * configure.in (jm_AC_TYPE_UINTMAX_T, jm_AC_PREREQ_XSTRTOUMAX,
869         HAVE_DECL_STRTOUL, HAVE_DECL_STRTOULL): Add.
870         (AC_REPLACE_FUNCS): Add strtoul.
871
872         * src/grep.c: Include xstrtol.h.
873         (ck_atio): Use xstrtoumax and do proper overflow checking.
874         (max_count, outleft): Now off_t, not int.
875         (main): Likewise. Use xstrtoumax to convert max_count from string.
876
877         * acconfig.h (HAVE_DECL_STRTOUL, HAVE_DECL_STRTOULL): New #undefs.
878         (HAVE_STPCPY, ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT,
879         HAVE_LC_MESSAGES): Remove.
880
881         * m4/decl.m4, m4/inttypes_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4,
882         m4/xstrtoumax.m4, src/strtol.c, src/strtoul.c, src/strtoull.c,
883         src/strtoumax.c, src/xstrtol.c, src/xstrtol.h, src/xstrtoumax.c:
884         New files, taken unchanged from textutils, fileutils, sh-utils
885         and/or tar.
886
887 2000-03-23  Paul Eggert
888
889         * src/search.c (Pcompile): Add support for NUL bytes in
890         Perl regular expressions.
891
892 2000-03-23  Paul Eggert
893
894         * NEWS, doc/grep.1, doc/grep.texi: Change --pcre to --perl-regexp.
895         * src/grep.c (long_options, usage): Likewise.
896
897         * doc/grep.1, doc/grep.texi: Remove pgrep program.
898         * src/Makefile.am (bin_PROGRAMS): Likewise.
899         (pgrep_SOURCES): Remove.
900
901         * src/grep.c (main): Rename matcher from "pgrep" to "perl".
902         * src/search.c (matchers): Likewise.
903
904         * src/search.c: Do not include stdio.h; no longer needed.
905         (NILP): Remove.
906         (sub): No longer static.
907         (n_pcre): Remove.
908         (cre): No longer an array.  Present only if HAVE_LIBPCRE.
909         (extra): New variable.
910         (Pcompile): Use fatal to report errors.
911         This also removes a possible core dump.
912         Add checks (marked FIXME) for restrictions in pcre.
913         Use pcre_maketables for proper localized behavior.
914         (Pcompile, Pexecute): Use GNU coding style.
915         The argument is a single pattern, not a list of patterns separated
916         by newlines; this is for consistency with grep and egrep.
917         Use pcre_study for speed.
918         (Pexecute): Abort if we lack pcre.
919         Abort if pcre_exec reports an impossible error.
920         Use code similar to the rest of search.c
921         to narrow down to the line we've found.
922
923 2000-03-21  Alain Magloire
924
925         * configure.in: added AC_CHECK_LIB(pcre, pcre_exec)
926         * ChangeLog: Typos corrected.
927         * src/search.c: new MACRO HAVE_LIBPCRE
928
929 2000-03-21  H.Merijn Brand
930
931         * src/Makefile.am(bin_PROGRAMS): added pgrep and new macro
932         pgrep_SOURCES.
933         * src/search.c: new functions Pcompile() and Pexecute()
934         to support PCRE.  Update matcher[] array for pgrep.
935         * src/grep.c: new short and long option --pcre and -P.
936         usage() updated.
937
938 2000-03-21  Bastiaan Stougie
939
940         Improvement of the -m or --max-count option. Now works for NUM > 1 and
941         prints trailing context for the last matching line.
942
943         * src/grep.c
944         (after_last_match): Is a new off_t variable that replaces inputhwm
945         to retain the correct input offset even after a call to fillbuf. Note
946         that after_last_match has a different meaning than inputhwm:
947         it always points to the offset in the input of the first byte after
948         the last matching line, and is 0 if no matching line has been found
949         yet.
950         (grep): Print trailing context after the NUMth match when the -m NUM
951         option is used.
952         (grep): Added comment. Should have been commented already.
953         (grepbuf): Now updates outleft correctly. This fixes the bug that the
954         -m NUM option did not stop after NUM lines for NUM greater than 1.
955         (grepbuf, prtext): Now update after_last_match instead of inputhwm.
956         (fillbuf): No longer updates inputhwm.
957         (prpending): When outputting trailing context of the max_count-th
958         matching line, stop at the first matching line.
959         (grepfile): Seek to after_last_match or eof, depending on the values
960         of outleft and bufmapped.
961         (usage): added the -m or --max-count option to the help message.
962         * doc/grep.texi, doc/grep.1: Document the change of the -m option.
963
964 2000-03-17  Paul Eggert
965
966         Add new -m or --max-count option, based on a suggestion by
967         Bastiaan Stougie.
968
969         * doc/grep.texi, doc/grep.1: Document it.
970         * src/grep.c (short_options, long_options, main): Add it.
971         (inputhwm): New variable.
972         (fillbuf, prtext, grepbuf): Set it.
973         (bufmapped): Now a macro (defined to zero) if HAVE_MMAP is not defined.
974         (max_count, outleft): New variables.
975         (prtext, grepbuf, grep): Don't output more than outleft lines.
976         (grepfile): If grepping standard input, seek to the limit of what
977         we've read before exiting.  This fixes a bug with mmapped input,
978         and is needed for proper -m support.
979         (main): Exit immediately if -m 0 is specified.
980
981 2000-03-08  Alain Magloire
982
983         * configure.in: version 2.4.2
984
985 2000-03-07  Paul Eggert
986
987         * Make intl subdirectory match fileutils, tar, etc.;
988         see intl/ChangeLog for details.
989
990         * src/getpagesize.h: Reformat to match latest fileutils.
991
992         * src/savedir.c (savedir): Work even if directory size is
993         negative; this can happen with some NFS screwups.
994
995 2000-03-03  Jim Meyering
996
997         * regex.m4: Make sure re_compile_pattern accepts patterns like `{1'.
998
999 2000-03-02  Alain Magloire
1000
1001         * 2.4.1 Release
1002
1003 2000-02-25  Paul Eggert
1004
1005         * configure.in (LIBOBJS): Work around automake 1.4 bug:
1006         regex.c wasn't being passed through ansi2knr on pre-ANSI hosts.
1007         (ac_use_included_regex): Fix typo in warning.
1008         * src/Makefile.am (EXTRA_DIST): Remove regex.c, as the LIBOBJS
1009         workaround means that automake now puts regex.c into DIST_COMMON.
1010
1011 2000-02-25  Alain Magloire
1012
1013         * po/*.po: update of the PO files.
1014
1015 2000-02-22  Eli Zaretskii
1016
1017         * doc/grep.1:  Two small glitches(typos).
1018
1019 2000-02-18  Eli Zaretskii
1020
1021         * djgpp/config.site (prefix, INSTALL): Use /dev/env/DJDIR instead
1022         of ${DJDIR}, so that the produced Makefile's work on any DJGPP
1023         installation.
1024
1025 2000-01-30 Alain Magloire
1026
1027         * doc/grep.1:  corrected typo.
1028         Noted by Ruslan Ermilov.
1029
1030 2000-01-30 Alain Magloire
1031
1032         * vms/Makefile.am: added config_vms.h to EXTRA_DIST.
1033         * vms/config_vms.h: New File, contains macros specific to VMS and
1034         avoid namespace collision with operating system supplied C library.
1035         * vms/make.com: Better compiler auto-detection; information for builds
1036         on pre-OpenVMS 7.x systems; general overhaul.
1037         * src/getpagesize.h: Reinstate support for different pagesizes on
1038         VAX and Alpha. Work around problem with DEC C compiler.
1039         * src/vms_fab.c: Cast to some assigments; fixed typo argcp vs. argp.
1040         * src/vms_fab.h: Added new include files to avoid warnings about
1041         undefined function prototypes.
1042         Those patches were provided by Martin P.J. Zinser (zinser@decus.de).
1043
1044 2000-01-30  Paul Eggert
1045
1046         * src/grep.c (main): Update copyright notice.
1047
1048 2000-01-28  Alain Magloire
1049
1050         * src/grep.c (usage):  The example "%s -i 'hello.*world' could
1051         lead to confusion when progname is 'fgrep.
1052         Noted by Akim Demaille.
1053
1054         * configure.in: Reenable, jm_INCLUDE_REGEX() since we now
1055         track GNU lib C.
1056         * src/Makefile.am: EXTRA_DIST new macros with regex.c regex.h.
1057         Requested By Ulrich Drepper.
1058
1059 2000-01-25  Paul Eggert
1060
1061         * src/grep.c (grep): If the final byte of an input file is not
1062         a newline, grep now silently supplies one.
1063         * doc/grep.texi, NEWS: Likewise.
1064
1065 2000-01-25  Paul Eggert
1066
1067         * NEWS, doc/grep.1, doc/grep.texi: Add -I option.
1068         * src/grep.c (short_options, usage, main): Likewise.
1069
1070         * doc/grep.texi: Fix some incorrect references to ASCII.
1071
1072 2000-01-25  Paul Eggert
1073
1074         * doc/grep.1: Simplify synopsis; sort options; mention
1075         environment variables; clean up some minor gaffes.
1076
1077 2000-01-25  Paul Eggert
1078
1079         * doc/grep.texi:
1080         Fix some errors in description of [:print:] and the like.
1081
1082 2000-01-23  Paul Eggert
1083
1084         * src/dfa.c (FETCH, lex): Put brackets around if-body to avoid
1085         GCC warning about ambiguous if-then-else.
1086
1087 2000-01-23  Paul Eggert
1088
1089         * src/regex.c (GET_UNSIGNED_NUMBER): Allow only ASCII digits.
1090         * src/dfa.c (ISASCIIDIGIT): New macro.
1091         (lex): Use it instead of ISDIGIT.
1092
1093 2000-01-23  Paul Eggert
1094
1095         The bug is that regular expression ranges like [a-z] compare raw
1096         byte codes to the range boundaries, whereas POSIX says that they
1097         should use the current collating sequence instead.  For example,
1098         in Solaris 7 with LC_ALL=en_US, the command
1099         echo x | grep '[ -~]'
1100         outputs 'x', but it shouldn't output anything since ' ' and '~'
1101         sort before all letters in that locale.
1102
1103         * src/regex.c (compile_range): When matching a character
1104         range, use the current collating sequence, as POSIX requires.
1105         * src/dfa.c (lex): Likewise.
1106
1107 2000-01-20  Alain Magloire
1108
1109         * tests/Makefile.am (dist-hook): Added new rule to make sure
1110         that the shell scripts have the right permissions.
1111         * src/posix/Makefile.am (EXTRA_DIST): added regex.h in the
1112         distribution.
1113         * THANKS: updated.
1114
1115 2000-01-18  Alain Magloire
1116
1117         * Rectification the initial patch to add --binary-file option
1118         was done by Ruslan Ermilov.
1119
1120 2000-01-17  Paul Eggert
1121
1122         Sync with sources of fileutils 4.0n, tar 1.13.17, glibc 2.1.3a1.
1123         Convert to ANSI C prototypes (using ansi2knr for backwards
1124         compatibility), as this makes it easier to sync.
1125
1126         * configure.in (AC_OBJEXT): Spell in a funny way, to work around
1127         a bug in automake 1.4 with ansi2knr.
1128         (LIBOBJS): Add assignment so that .o files in LIBOBJS are also built
1129         via the ANSI2KNR-filtering rules.
1130         (AC_OUTPUT): Add src/posix/Makefile.
1131         * src/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
1132         (SUBDIRS): New macro.
1133         * src/ansi2knr.1, src/ansi2knr.c, src/posix/Makefile.am: New files.
1134         * src/dfa.c, src/dosbuf.c, src/grep.c, src/kwset.c, src/search.c,
1135         src/vms_fab.c:
1136         Use prototypes for function definitions.
1137         * src/grep.c (main): Use int counter for default context,
1138         fixing an ANSI portability bug uncovered by the above changes.
1139
1140         * config.guess, config.sub, install-sh, missing, src/alloca.c,
1141         src/getpagesize.h, src/memchr.c, src/savedir.c, src/savedir.h,
1142         src/stpcpy.c:
1143         Upgrade to latest version from fileutils 4.0n.
1144
1145         * src/getopt.c, src/getopt.h, src/getopt1.c: Upgrade to latest
1146         version from tar 1.13.17.
1147
1148         * src/obstack.c, src/obstack.h, src/regex.c, src/regex.h:
1149         Upgrade to glibc 2.1.3 alpha 1, with K&R C portability fix.
1150         * src/posix/regex.h: New file, from glibc 2.1.3 alpha 1.
1151
1152 2000-01-04  Paul Eggert
1153
1154         Initial patch by Ruslan Ermilov.
1155
1156         Add --binary-files option.
1157         * NEWS, doc/grep.1, doc/grep.texi: Document it.
1158         * src/grep.c (BINARY_FILES_OPTION): New constant.
1159         (long_options, grep, usage, main): New --binary-files option.
1160         (binary_files): New var.
1161         * src/system.h (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, CHAR_MAX):
1162         New macros.
1163         (INT_MAX, UCHAR_MAX): Define in terms of TYPE_MAXIMUM.
1164
1165 2000-01-04  Paul Eggert
1166
1167         * savedir.c (savedir): Don't store past the end of an array if
1168         name_size is zero and the directory is empty.
1169         Reported by Dima Barsky <dima@pwd.hp.com>.
1170
1171 1999-12-03  Alain Magloire
1172
1173         * 2.4 Release.
1174
1175 1999-11-18  Paul Eggert
1176
1177         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a
1178         problem with the QNX 4.25 shell, which doesn't propagate exit
1179         status of failed commands inside shell assignments.
1180
1181 1999-11-13  Eli Zaretskii
1182
1183         * doc/grep.texi: Minor markup and spelling corrections.  Use
1184         @noindent where appropriate.
1185
1186         * PATCHES-{AM,AC}: rename to PATCHES.{AM,AC}
1187
1188 1999-11-12  Eli Zaretskii
1189
1190         doc/grep.texi: Minor fixes and typos corrected.
1191         djgpp/README: Updated version.
1192
1193 1999-11-07  Paul Eggert
1194
1195         * src/grep.c (usage): Fix misspelling.
1196
1197 1999-11-07  Paul Eggert
1198
1199         Don't assume that the C library has re_set_syntax and friends.
1200         * src/Makefile.am (base_sources): Add regex.c, regex.h.
1201         (EXTRA_DIST): Remove regex.c, regex.h.
1202
1203         * src/grep.c (prtext): Use out_quiet, not not_text, to decide
1204         whether to set pending to zero at the end.
1205         (not_text): Remove static variable, undoing latest change.
1206         (grep): Likewise.
1207
1208         * doc/grep.texi: Tighten up the text, and fix some minor
1209         spelling and usage errors.  Use @enumerate rather than @table
1210         @samp, since it's better for Q&A format.  Add cross
1211         references.
1212
1213 1999-11-01 Alain Magloire
1214
1215         * src/search.c: Use the more portable [[:alnum:]]
1216         to define a word instead of Ascii dependent [0-9A-Za-z]
1217         * src/grep.c: make not_text global to not display text when
1218         the context switches -A/-B/-C are use on binary files.
1219         * make grep-2.3g available for testing.
1220         * configure.in: drop support for --without-included-regex.
1221         This was generating bogus bug reports, since many GNU/Linux
1222         users have different version of glibc.  And glibc maintainers
1223         decided to drop k&r support.
1224
1225 1999-11-01 Arnold D. Robbins
1226
1227         * regex.c (init_syntax_once): move below definition of
1228         ISALNUM etc., then use ISALNUM to init the table, so that
1229         the word ops will work if i18n'ed.
1230         (SYNTAX): And subscript with 0xFF for Latin-1 characters.
1231
1232 1999-10-26  Alain Magloire
1233
1234         * src/regex.c: Merge changes from GNU lib C.
1235         * Updated the *.po files
1236
1237 1999-10-26  Paul Eggert
1238
1239         * src/grep.c (fillbuf): Don't report buffer size overflow if
1240         newalloc == save and maxalloc == save.  This can happen
1241         e.g. when reading a large page-aligned file that contains
1242         no newlines.
1243
1244 1999-10-21  Paul Eggert
1245
1246         * src/grep.c (usage): Give example.  Clarify -F.
1247         Explain exit status more clearly.
1248
1249 1999-10-12  Paul Eggert
1250
1251         * doc/grep.texi: Shorten the commentary about egrep and {.
1252         "BSD grep" -> "traditional grep".
1253         * doc/grep.1: Match recent changes to grep.texi.
1254
1255 1999-10-11  Paul Eggert
1256
1257         * NEWS, doc/grep.1, doc/grep.texi: New option --mmap.
1258         * src/grep.c (mmap_option): New variable.
1259         (long_options, reset, usage): Add --mmap.
1260         Default is now read, not mmap.
1261
1262         * doc/grep.1: Document -Z or --null.
1263
1264 1999-10-11  Paul Eggert
1265
1266         * doc/grep.texi: Fix texinfo glitches.  POSIX -> POSIX.2 where
1267         appropriate.
1268
1269 1999-10-11  Paul Eggert
1270
1271         * acconfig.h (ssize_t): New #undef.
1272
1273         * configure.in (AC_CHECK_TYPE): Add ssize_t.
1274
1275         * src/grep.c (PREFERRED_SAVE_FACTOR): New macro.
1276         (reset): If the buffer has already been allocated, set bufsalloc to
1277         be bufalloc / PREFERRED_SAVE_FACTOR.  This avoids problems when
1278         bufsalloc == bufalloc (possible after reading a large binary file).
1279         (reset): Use PREFERRED_SAVE_FACTOR instead of magic constant.
1280         Do not set bufbeg; nobody uses it.
1281         Always set buflim.
1282         Check for lseek error.
1283         Use SEEK_CUR, not a magic constant.
1284         (fillbuf): Return an error indication, not a count.
1285         All callers changed.
1286         Do not assume ssize_t fits in int.
1287         Use PREFERRED_SAVE_FACTOR instead of magic constant.
1288         Clean up mmap code.
1289         Do not attempt to mmap zero bytes.
1290         Check for lseek error.
1291         Use SEEK_SET, not a magic constant.
1292         Work correctly if read is interrupted.
1293         (grepfile): Work correctly if open or close is interrupted.
1294
1295         * src/system.h (SEEK_SET, SEEK_CUR): New macros.
1296
1297 1999-10-02 Alain Magloire
1298
1299         * src/regex.[ch]: upgrade from GNU lib C source tree.
1300
1301         * make beta 2.3f available.
1302
1303 1999-10-02  Paul Eggert
1304
1305         * NEWS: egrep is now equivalent to `grep -E'.
1306         The lower bound of an interval is not optional.
1307         You can specify a matcher multiple types without error.
1308         -u and -U are now allowed on non-DOS hosts, and have no effect.
1309         * doc/grep.texi: Likewise.
1310         * doc/grep.1: Likewise.
1311         Fix some troff bugs that prevented `groff' from rendering the page.
1312
1313         * src/egrepmat.c, src/fgrepmat.c, src/grepmat.c (default_matcher):
1314         Remove.
1315         (matcher): Add.
1316         * src/grep.h (default_matcher): Remove.
1317         (matcher): Now exported from ?grepmat.c, not grep.c.
1318
1319         * src/dfa.c (lex): If { would start an invalid interval specification,
1320         treat it as a normal character.
1321         Remove (broken) support for {,M} meaning {0,M}.
1322         Diagnose bogus intervals like {1,0}.
1323         (closure): maxrep is now -1 to indicate no limit, not zero;
1324         zero is a valid value for maxrep, meaning an upper bound of zero.
1325
1326         * src/grep.c (short_options): New constant.
1327         (long_options, main): -u and -U are now supported on Unix,
1328         with no effect.
1329         (matcher): Removed; now defined by ?grepmat.c.
1330         (install_matcher): Renamed from setmatcher.
1331         (setmatcher): New function.
1332         (usage): Report new, more uniform option scheme.
1333         (main): Do not initialize matcher; ?grepmat.c now does this.
1334         Rely on setmatcher to catch matcher conflicts.
1335         Default matcher is "grep".
1336
1337         * src/search.c (matchers):
1338         Remove "posix-egrep" matcher; no longer needed.
1339         (Ecompile): Likewise.
1340         The egrep matcher now has POSIX behavior.
1341
1342         * tests/bre.tests: grep '\{' is no longer an error.
1343         Fix test for interval too large, and enable it.
1344         * tests/ere.tests: grep -E {1 is no longer an error
1345         Likewise for a{1, a{1a, a{1a}, a{1,x}.
1346
1347 1999-09-22  Paul Eggert
1348
1349         * largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around GCC
1350         2.95.1 bug with HP-UX 10.20.
1351
1352 1999-09-12  Paul Eggert
1353
1354         * src/grep.c (fillbuf): Fix typo: we sometimes reported
1355         arithmetic overflow even when there wasn't any.
1356
1357 1999-09-12  Paul Eggert
1358
1359         * configure.in (AC_CHECK_FUNCS): Add memmove.
1360
1361         * src/system.h (S_ISREG): New macro.
1362         (memmove): Define if ! defined HAVE_MEMMOVE && ! defined memmove,
1363         not if !defined STDC_HEADERS.  This is needed for SunOS 4.1.4,
1364         which defines STDC_HEADERS but lacks memmove.
1365
1366         * src/grep.c (bufoffset): Needed even if !defined HAVE_MMAP.
1367         (reset): Always fstat the file, since we always need its size if it is
1368         regular.
1369         Similarly, get the buffer offset of every regular file.
1370         Set bufmapped to 0 if the file's initial offset is not a multiple
1371         of the page size.
1372         (fillbuf): Calculate an upper bound on how much memory we should
1373         allocate only for regular files, since we don't know the sizes of
1374         other files.
1375         Don't bother to check whether the file offset is a multiple of the page
1376         size, since we now do that just once in `reset'.
1377         When an mmapped area would fall past the end of the file, trim it to
1378         just before instead of giving up immediately and doing a `read';
1379         that avoids a worst-case behavior that could read half an mmapped file.
1380         Fix bug when computing offsets on hosts that don't have mmap.
1381
1382 1999-08-27  Paul Eggert
1383
1384         * src/system.h (memmove): New macro.
1385
1386         * src/grep.c (page_alloc): Reallocate the old buffer instead
1387         of having both old and new buffers active simultaneously.
1388         Remove valloc debugging variant, which no longer applies.
1389
1390         (fillbuf): Rejigger the buffer allocation mechanism.  The old
1391         mechanism could allocate more than 10*N bytes for an N-byte
1392         file, which was excessive.  Check for arithmetic overflow a
1393         bit more carefully.
1394
1395 1999-08-25  Paul Eggert
1396
1397         * src/grep.c (grepdir):
1398         Don't assume that st_ino and st_dev must be integers;
1399         POSIX.1 allows them to be floating-point (!).
1400
1401         * src/vms_fab.h (arr_ptr): `:' -> `;' to fix typo.
1402
1403 1999-08-18  Alain Magloire
1404
1405         * 2.3e snapshot.
1406
1407 1999-08-18  Alain Magloire
1408
1409         * src/search.c: On a CRAY J90 system running UNICOS 8.0.
1410         Compilation of ./src/search.c failed because the declaration of
1411         the variable "regex":
1412           static struct re_pattern_buffer regex;
1413         conflicted with a previous declaration search.c #includes "system.h",
1414         which #includes <stdlib.h>, which declares :
1415         extern char *regex __((char *_Re, char *_Subject, ...));
1416         The declaration in search.c is local to that one source file.
1417         I just changed its name to something less likely to conflict.
1418         (I called it "regexbuf", but you could pick any name you want.)
1419         Excerpt email from Dean Kopesky.
1420
1421 1999-08-16  Paul Eggert
1422
1423         Upgrade large-file support to the version used in tar and
1424         textutils.
1425
1426         * Makefile.am (ACLOCAL_AMFLAGS): Define to be empty.
1427         (M4DIR, ACINCLUDE_INPUTS): New macros.
1428         ($(srcdir)/acinclude.m4): New rule.
1429
1430         * configure.in (AC_CANONICAL_HOST, AM_C_PROTOTYPES): Add.
1431         (AC_SYS_LARGEFILE): Renamed from AC_LFS, for compatibility
1432         with what should appear in the next autoconf release.
1433
1434         * m4/largefile.m4: Renamed from m4/lfs.m4.
1435
1436         * src/ansi2knr.1, src/ansi2knr.c, config.guess, config.sub:
1437         New files.  config.guess and config.sub ar needed by the new
1438         AC_SYS_LARGEFILE.  ansi2knr is needed by AM_C_PROTOTYPES,
1439         which in turn is needed by the new AC_SYS_LARGEFILE.
1440
1441 1999-08-16  Alain Magloire
1442
1443         * 2.3d snapshot on ftp server.
1444
1445 1999-07-26  Paul Eggert
1446
1447 Several GNU tools have options to process arbitrary file names, even
1448 file names that contain newline characters.  These include `find
1449 -print0', `perl -0', `sort -z', and `xargs -0'.  It'd be handy if GNU
1450 grep also processed such file names.  Here's a proposed patch to do
1451 this, relative to grep 2.3c.  This patch introduces two options, one
1452 for the data, and one for the file names.  (Sometimes one wants
1453 null-terminated file names in the output, and sometimes one wants to
1454 process lists of null-terminated strings, and these are orthogonal
1455 axes.)
1456
1457         * NEWS, doc/grep.texi: New -z or --null-data and -Z or --null options.
1458         * src/grep.c (long_options, usage, main): Likewise.
1459
1460         * src/dfa.h (dfasyntax): New eol parameter.
1461         * src/dfa.c (eolbyte): New var.
1462         (dfasyntax): Set it from new parameter.
1463         (lex, dfastat, build_state, dfaexec): Use it instead of '\n'.
1464
1465         * src/grep.h (eolbyte): New decl.
1466         * src/grep.c (eolbyte): New var.
1467         (nlscan, prpending, prtext, grepbuf, grep): Use it instead of '\n'.
1468         (filename_mask): New var.
1469         (prline, grepfile): Output NUL separator if filename_mask is zero.
1470         (grep): Look for '\200' as the hallmark of a binary file, not '\0',
1471         if -z or --null-data is specified, since it implies that '\0' is
1472         expected as text.
1473
1474         * src/search.c (Gcompile, Ecompile): Pass eolbyte to dfasyntax.
1475         (EGexecute, Fexecute): Use eolbyte instead of '\n'.
1476
1477 1999-06-15 Alain Magloire
1478
1479         * src/grep.c, doc/grep{1,texi} :
1480         --revert-match should be --invert-match.
1481         Correction proposed by Karl Berry.
1482
1483 1999-06-12 Alain Magloire
1484
1485         * doc/grep.{1,texi}: add description for --with-filename.
1486         Noted missing by UEBAYASHI Masao.
1487
1488 1999-03-17 Paul Eggert
1489
1490         * NEWS: Add GREP_OPTIONS.
1491
1492         * doc/grep.texi: Document GREP_OPTIONS, and the other
1493         environment variables.  Fix doc for [:blank:], [:cntrl:], [:punct:].
1494
1495         * src/grep.c (prepend_args, prepend_default_options): New functions.
1496         (main): Use them to implement GREP_OPTIONS.
1497         * src/system.h (getenv): New decl.
1498
1499 1999-03-16 Volker Borchert
1500
1501         * configure.in: Use case case ... esac for  checking Visual C++.
1502         When ${CC} contains options it was not recognize.
1503
1504 1999-03-07 Paul Eggert
1505
1506         * src/grep.c (usage): Don't report -E, -F, and -G unless we're grep.
1507         (main): Don't match options -E, -F, and -G unless we're grep.
1508         Remove after-the-fact check for options -E, -F, and -G, since
1509         they're no longer needed.
1510
1511 1999-03-05  Eli Zaretskii
1512
1513         * src/grep.c (main): Print the name of the default matcher instead
1514         of just "grep".
1515
1516 1999-02-06 Alain Magloire
1517
1518         * tests/*.awk : Linux users are seeing "Broken Pipe" on make check.
1519         The problem is that grep does not drain its stdin, thus the previous
1520         process in the pipeline receives a SIGPIPE.  Other shells are silent
1521         about this.  There is actually no failure, since the broken pipe is
1522         expected.  You can work around it by changing the pipeline, so that
1523         the input is drained, like this:
1524         status=`echo 'check' | { ${GREP} -E -e pattern >/dev/null 2>&1;
1525         echo $?; cat >/dev/null; }`; if test $status -ne $errnu then ... fi
1526         Excerpt email from Andreas Schwab.
1527
1528 1999-02-23 Alain Magloire
1529
1530         * src/grep.c : Restrict the use of -E, -F, -G
1531         to only grep driver, Posix behaviour. {f,e}grep
1532         the matcher is already set. This change may brake
1533         scripts, warn in NEWS.
1534
1535         * doc/grep.{1,texi} : -C takes arguments, upgrade manual.
1536
1537         * beta 2.3a
1538
1539 1999-02-23 Alain Magloire
1540
1541         * configure.in : Change the configure VC test from
1542         'test x$ac_cv_prog_CC = xcl;' to 'test x"$ac_cv_prog_CC" = xcl;'
1543         Email from Joshua R. Poulson.
1544
1545 1999-02-23 Paul Eggert
1546
1547         Fix porting bug reported by Amakawa Shuhei for SunOS 4.1.4-JL.
1548         The btowc.c shipped with grep 2.3 is incorrect for Solaris
1549         2.5.1 and earlier, as it assumes UTF8, which these OSes do not
1550         support.  Solaris 7 supports btowc, so there's no need to ship
1551         a substitute for it.  The only questionable case is Solaris
1552         2.6, which lacks btowc but does support UTF8.  However, 2.6
1553         supports UTF8 but only as a demonstration (for an English
1554         locale!); Japanese Solaris 2.6 users typically use EUC, or
1555         sometimes shift-JIS, but they cannot use UTF8 since Japanese
1556         UTF8 is not supported.  Hence there's no point to having grep
1557         substitute a btowc that uses UTF8, as it is either redundant,
1558         or it will almost invariably have incorrect behavior.
1559
1560         * configure.in (AC_CHECK_HEADERS): Don't set USE_WCHAR.
1561         (AC_CHECK_FUNCS): Add btowc, wctype.
1562         (AC_REPLACE_FUNCS): Don't replace btowc; our replacement is
1563         invariably doing the wrong thing anyway, at least on SunOS/Solaris.
1564         Don't bother to check for wctype in -lw, as we don't support
1565         wide characters on Solaris 2.5.1 or earlier anyway.
1566
1567         * bootstrap/Makefile.try (OBJS): Remove btowc.$(OBJEXT).
1568
1569         * src/btowc.c: Removed; no longer needed.
1570
1571 1999-02-19  Paul Eggert
1572
1573         * NEWS: Fix typo when talking about the old behavior of
1574         silently skipping directories; it was grep 2.1, not grep 2.2.
1575
1576 1999-02-15 Alain Magloire
1577
1578         * bootstrap/Makefile.try : add DJGPP DEFS.
1579         Done by Elie Zaretsckii.
1580
1581 1999-02-14 Alain Magloire
1582
1583         * m4/gettext.m4 : Guard [] with changequote.
1584         From Elie Zaretskii.
1585
1586         * djgpp/config.bat : Makefile.in.in --> Makefile.in-in
1587         From Elie Zaretskii.
1588
1589         * src/dosbuf: k&r function parameter.
1590
1591         * release of 2.3.
1592
1593 1999-02-10 Alain Magloire
1594
1595         * bootstrap/{Makefile{try,am},REAMDE} : skeleton
1596         provided for system lacking the tools to autoconfigure.
1597
1598         * src/{e,f,}grepmat.c: added guard [HAVE_CONFIG_H]
1599
1600 1999-02-10 Alain Magloire
1601
1602         * PATCHES-AC, PATCHES-AM: updated.
1603
1604         * m4/regex.m4 : updated.
1605
1606 1999-02-05 Eli Zaretskii
1607
1608         * m4/gettext.m4 : Support DOS-style D:/foo/bar absolute file
1609         names.
1610
1611         * aclocal.m4 (DJGPP) : Use $DJ_GPP instead, since changing the
1612         latter prevents GCC from finding headers and libraries.
1613
1614         * djgpp/config.bat: Make building from another directory work
1615
1616         * djgpp/config.sed: Remove redundant command wich edited path
1617         separator: now done by configure.
1618
1619         * src/grep.c [O_BINARY]: Add prototype for undossify_input.
1620
1621         * doc/grep.texi (Introduction): Typo fixed.
1622
1623 1999-02-03 Alain Magloire
1624
1625         * grep-2.2f beta release.
1626
1627 1999-02-02 Alain Magloire
1628
1629         * m4/{djgpp,envsep,glibc,regex,dosfile,isc-posix}.m4 :
1630         New files to aid configuration and unload configure.in.
1631         * m4/Makefile.am : updated.
1632         * src/btowc.c : protect for wchar.h
1633
1634 1999-01-28 Alain Magloire
1635
1636         * intl/Makefile.in: Replace .o with .${ac_objext} where necessary.
1637         Work around a limitation of Visual C++ on Cygwin32.
1638         * acconfig.h configure.in: Define `alloca' as `_alloca' when CC=cl.
1639         This little hack was suggested by Ian Roxborough <irox@cygnus.com>.
1640         Patch forwarded by Ben Elliston.
1641
1642 1999-01-28 Alain Magloire
1643
1644         * PATCHES-AM: New file. A small patch for automake-1.4, use $(sep)
1645         as the path separator base on @SEP@.
1646         * PATCHES-AC configure.in : updated for autoconf-13.
1647
1648 1999-01-27 Volker Borchert
1649
1650         * grep.c: fgrep -NUM not working correctly.
1651         add the argument number to digit_args_val.
1652
1653 1999-01-22 Paul Eggert
1654
1655         Prevent grep -r from recursing infinitely through directory loops via
1656         symbolic links.
1657
1658         * grep.c (struct stats): New type.
1659         (stats_base): New var.
1660         (bufstat): Remove; subsumed by stats->stat.
1661         (reset, fillbuf, grep, grepdir, grepfile): Pass struct stats * arg,
1662         for directory loop checking; use this instead of the bufstat global.
1663         All callers changed.
1664         (grepfile): Stat the file before invoking grepdir.
1665         (grepdir): Assume that the argument has already been statted.
1666         No longer a need for a directory size argument, since it
1667         can be gotten from the struct stats * argument.
1668         Check for directory loops.
1669         Create linked list of directories currently being visited,
1670         to detect loops.
1671
1672 1998-12-29 Kaveh R. Ghazi
1673
1674         intl/localealias.c: When building grep-2.2e using cc on Irix4,
1675         I needed the following patch to intl/localealias.c.
1676         (Its the same patch used by fileutils-4.0.) The patch resolves
1677         conflicts between char* and unsigned char* in the i18n code.
1678
1679 1998-12-10 Alain Magloire
1680
1681         * src/grep.c : Typo in contex -->context
1682         Noted by  Vladimir Michl.
1683
1684 1998-12-01  Alain Magloire
1685
1686         * doc/Makefile.am djgpp/Makefile.am m4/Makefile.am vms/Makefile.am:
1687         New files.
1688
1689         * m4/progtest.m4: proctect '[]' from m4.
1690         Noted by Eli Z.
1691
1692         * PATCHES-AC: New file, add the patch for autoconf in the dist.
1693
1694         * acconfig.h: (HAVE_DOS_FILENAME)
1695
1696         * TODO: updated.
1697
1698         * src/search.c: remove obsolete 'gegrep,ggrep,gnugrep'
1699         matchers. grep no longer depend on argv[0].
1700
1701         * grep-2.2e beta to test DJGPP port.
1702
1703 1998-11-28  Paul Eggert
1704
1705         Various portability enhancements:
1706         - Don't assume that O_BINARY implies DOS.  Use separate
1707         macros D_OK (for DOS-like directory access) and
1708         HAVE_DOS_FILE_NAMES (for DOS-like file names).
1709         - Don't assume that off_t fits into long; it doesn't on Solaris 2.6.
1710         - Have is_EISDIR set errno properly on hosts with screwed-up EISDIR.
1711         - Treat ':' specially in DOS file names only if it's the end of a
1712         drive specifier.
1713         - Protect against errno < 0.
1714
1715         * src/grep.c (is_EISDIR): Move defn to system.h.
1716         (print_offset_sep): New function.
1717         (fillbuf): Remove redundant test of O_BINARY.
1718         (totalcc, totalnl): Now of type off_t.
1719         (prline): Use print_offset_sep to print file offsets.
1720         (grepfile): Don't set e to EISDIR; that's is_EISDIR's responsibility
1721         on machines that don't work properly with EISDIR.
1722         (grepdir): Don't assume ':' means slash on all DOS filenames;
1723         it means it only in the file prefix.
1724
1725         * src/system.h (strerror): Check for negative error numbers.
1726         (is_EISDIR): Depend on D_OK, not O_BINARY.
1727         (SET_BINARY): Depend on HAVE_SETMODE, not __DJGPP__.
1728         (IS_SLASH, FILESYSTEM_PREFIX_LEN): Depend on HAVE_DOS_FILE_NAMES,
1729         not O_BINARY.
1730         (CHAR_BIT): New macro.
1731
1732         * src/dosbuf.c (struct dos_map):
1733         pos and add members are now of type off_t.
1734         (dos_stripped_crs): Now of type off_t.
1735         (dossified_pos): Now accepts arg and returns value of type off_t.
1736
1737         * configure.in (AC_CHECK_FUNCS): Add setmode.
1738         (HAVE_DOS_FILENAMES): New macro
1739
1740 1998-11-27  Eli Zaretskii
1741
1742         * djgpp/config.sed: New file, a Sed script to edit configure
1743         script before running it on DOS/Windows.
1744         * djgpp/config.bat: Updated to handle po2tbl.sed.in and
1745         po/Makefile.in.in on DOS filesystems, and to run config.sed.
1746
1747 1998-11-24  Jim Meyering
1748
1749         * src/grep.c : Typo s/infalid/invalid/
1750         Also noted by Stanislav Brabec.
1751
1752 1998-11-24  Eli Zaretskii
1753
1754         * doc/grep.texi: I found and corrected several typos.
1755         I believe the GNU standards require the section that describes the
1756         options to the programs to be called ``Invoking'' or ``Invoking
1757         <program-name>''.  This is so users and programs can easily find
1758         that node in any Info file.  So I changed the name of the
1759         `Options' chapter to `Invoking', and corrected the
1760         cross-references accordingly.
1761         I added some markup to things like file names and options.
1762         I added some additional index entries where that seemed useful.
1763         I also corrected some index entries, such as "@cindex [:alnum:]",
1764         which used a colon in them (the colons confuse Info readers).
1765
1766 1998-11-24  Alain Magloire
1767
1768         * grep/doc/grep.texi : -h is not use for help.
1769         Nit spotted by Jim Meyering.
1770
1771 1998-11-23  Alain Magloire
1772
1773         * doc: New directory, grep.1, {e,f}grep.man move here
1774         * doc/grep.texi: New info manual
1775         * doc/version.texi: New
1776         * doc/Makefile.am: New
1777         * tests/{ere,bre}.*: New files. The spencer2 test is split
1778         in two ere/bre.
1779         * config.hin: New, config.h.in rename to config.hin for OS
1780         with limited file system aka DOS.
1781
1782         * grep-2.2d release for beta.
1783
1784 1998-11-18  Alain Magloire
1785
1786         * src/regex.[ch] : Updated from GLibc, previous patches were
1787         integrate by Ulrich Drepper and some added ones.
1788
1789 1998-11-16  Paul Eggert
1790
1791         * grep.h (__attribute__): New macro, if not GCC.
1792         (fatal): Add __attribute__((noreturn)).
1793         * grep.c (usage): Add __attribute__((noreturn)).
1794
1795 1998-11-16  Paul Eggert
1796
1797         Remove memory leak with valloced buffers, by invoking malloc instead.
1798
1799         * configure.in (AC_CHECK_FUNCS), src/system.h (valloc): Remove.
1800         * src/grep.c (page_alloc): New function.
1801         (ubuffer, pagesize): New vars.
1802         (ALIGN_TO): New macro.
1803         (reset): Initialize new vars.  Check for overflow in buffer size calc.
1804         Use page_alloc instead of valloc.
1805         (fillbuf): Likewise.  Use memcpy to copy saved area.
1806
1807 1998-11-15  Paul Eggert
1808
1809         * dfa.c (dfacomp), search.c (EGexecute): Don't assume char is unsigned.
1810
1811 1998-11-14  Paul Eggert
1812
1813         * src/grep.c (grepdir): Fix bug: memory freed twice.
1814
1815         * src/search.c (Gcompile, Ecompile): Don't invoke dfainit,
1816         since dfacomp does it for us, and if we also do it then we
1817         leak memory.
1818
1819 1998-11-13  Eli Zaretskii
1820
1821         * djgpp/config.bat: Rewrite to run the configure script via Bash.
1822         * djgpp/config.site, djgpp/getconf: New files.
1823         * djgpp/config.h, djgpp/*.mak, djgpp/po2tbl.sed: Remove.
1824         * djgpp/README: Update instructions.
1825
1826         * Makefile.am (EXTRA_DIST): Update the list of DJGPP files.
1827
1828         * src/system.h (IS_SLASH): New macro.
1829         (is_EISDIR): Define it here for DOS and Windows.
1830
1831         * src/grep.c (main) [O_BINARY]: Set stdout to binary mode, so the
1832         EOL formats of the input and output files match, unless stdout is
1833         the console device.
1834         (is_EISDIR): Don't define if already defined.  Accept a second
1835         argument, the file name; all callers changed.
1836         (grepdir): Don't free `file', inside the loop.  Use IS_SLASH to
1837         check whether `dir' needs a slash.
1838         (grepfile): If file is a directory, set e to EISDIR.
1839
1840 1998-11-10  Alain Magloire
1841
1842         * src/vms_fab.{c,h}: New file for VMS wildcard expansion
1843         Written by Phillip C. Brisco.
1844
1845         * vms/make.com : add line to compile vms_fab.c and
1846         {e,f,}grepmat.c with link for each grep/fgrep/egrep.
1847         Base on patch send by Phillib C. Brisco.
1848
1849 1998-11-09  Alain Magloire
1850
1851         * grep-2.2c on alpha for testing.
1852
1853 1998-11-09  Paul Eggert
1854
1855         * src/grep.1: Fix `Last Change' of output by generating the date
1856         from the RCS Id.
1857
1858         * src/grep.c (is_EISDIR): New macro.
1859         (grep): If -s, suppress errors from trying to read directories.
1860         (grepfile): Use is_EISDIR to simplify code.
1861         (grepdir): If -s, suppress errors from trying to read directories.
1862
1863         * src/grep.1: Fix -q -r -s problems; describe BSD grep better.
1864
1865         * src/grep.c (main): Update copyright.
1866
1867         Specify default matcher with default_matcher extern var, not
1868         DEFAULT_MATCHER macro.  This is more straightforward and means
1869         we need to compile grep.c just once.
1870
1871         * src/egrepmat.c, src/fgrepmat.c, src/grepmat.c: New files.
1872
1873         * src/Makefile.am (base_sources): New macro.
1874         (egrep_SOURCES, fgrep_SOURCES, grep_SOURCES): Now consist of
1875         $(base_sources) plus the single tailoring file.
1876         (grep_LDADD, egrep_LDADD, fgrep_LDADD): Remove.
1877         (EXTRA_DIST): Remove grep.c, regex.c.
1878         (fgrep.o, egrep.o): Remove.
1879
1880         * src/grep.h (matcher): Now char const *.
1881         (default_matcher): New decl.
1882
1883         * src/grep.c (matcher): Now char const *.
1884         (setmatcher): Now accepts char const *.
1885         (main): Default the matcher from default_matcher (linked externally)
1886         rather than DEFAULT_MATCHER (a macro).
1887
1888 1998-11-08 Alain Magloire
1889
1890         * src/grep.1: `prep.ai.mit.edu' should be replaced with `gnu.org'.
1891         Nit from Paul Eggert.
1892
1893 1998-11-06 Alain Magloire
1894
1895         * src/grep.c: The Matcher is not set to argv[0] but
1896         explicitly by a #define MATCHER at compile time default is "grep".
1897
1898         * aclocal/: NEW dir. provides our own *.m4
1899
1900         * configure.in: Move Paul's Large Files to AC_LFS.(aclocal/lfs.m4)
1901         Taken from Jim Meyering fileutils.
1902
1903 1998-11-05 Alain Magloire
1904
1905         * src/grep.1: update the man pages according to the
1906         changes make by Miles.
1907
1908         * po/*.po: updated.
1909
1910         * first beta release for 2.3 (2.2a).
1911
1912 1998-11-04 Miles Bader
1913
1914         * src/grep.c (main): Rationalize interaction of -C/-NUM/-A/-B
1915         options, and allow -C to have an optional argument. -NUM can
1916         now be mixed with -C, and -A, -B always take precedence over
1917         -C/-NUM, regardless of order.
1918         (long_options): Let -C/--context take an optional argument.
1919
1920 1998-11-03 Alain Magloire
1921
1922         * src/dfa.c: HP-UX define clrbit/setbit as macros in <sys/param.h>
1923         #undef if defined.
1924         Fixed by Andreas Ley and Philippe Defert.
1925
1926         * src/grep.1 : mention that -s follows POSIX.2 behavior.
1927         Noted by Paul Eggert and others.
1928
1929         * tests/khadafy.sh: a typo in failure(s).
1930         Spotted By Sotiris Vassilopoulos.
1931
1932 1998-11-01  Paul Eggert
1933
1934         * src/system.h (IN_CTYPE_DOMAIN): New macro.
1935         (ISALPHA, ISUPPER, ISLOWER, ISDIGIT, ISXDIGIT, ISSPACE,
1936         ISPUNCT, ISALNUM, ISPRINT, ISGRAPH, ISCNTRL): Use
1937         IN_CTYPE_DOMAIN instead of isascii.
1938
1939 1998-08-18  Paul Eggert
1940
1941         Add support for new -r or --recursive (or -d recurse or
1942         --directories=recurse) option.
1943
1944         * src/Makefile.am (grep_SOURCES): Add savedir.c, savedir.h, stpcpy.c.
1945
1946         * src/grep.1: Describe new options.
1947
1948         * src/grep.c: Include "savedir.h".
1949         (long_options): Add -r or --recursive.
1950         (RECURSE_DIRECTORIES): New enum value.
1951         (IS_DIRECTORY_ERRNO): Remove.
1952         (reset, grep): Add file name arg.
1953         (grepdir, grepfile): New functions.
1954         (initial_bufoffset): New var.
1955         (reset): Initialize it.
1956         (fillbuf): Use it.
1957         (count_matches, list_files, no_filenames, suppress_errors): New static
1958         vars; formerly were local to `main'.
1959         (grep): Recurse through directories if the user asks for this.
1960         (usage, main): Add new options.
1961         (main): Change some local vars to be static, as described above.
1962         Move most of the guts into grepfile function.
1963         so that it can be recursed through.
1964
1965         * configure.in (AC_HEADER_DIRENT, AC_FUNC_CLOSEDIR_VOID): Add.
1966         (AC_REPLACE_FUNCS): Add stpcpy.
1967
1968         * src/savedir.c, src/savedir.h, src/stpcpy.c: New files;
1969         taken from fileutils 3.16u.
1970
1971 1998-08-11  Paul Eggert
1972
1973         * src/system.h (initialize_main): New macro.
1974         * src/grep.c (main): Invoke initialize_main first thing.
1975
1976 1998-04-29  Paul Eggert
1977
1978         * NEWS, src/grep.1: Describe new -a and -d options.
1979
1980         * src/grep.c (long_options, usage, main):
1981         New options -d or --directories and -a or --text.
1982         (directories, always_text): New variables.
1983         (IS_DIRECTORY_ERRNO): New macro.
1984         (reset): Now returns value specifying whether to skip this file.
1985         Stat the file if either mmap or directory-skipping is possible.
1986         Skip the file if it's a directory and we're skipping directories.
1987         (grep): Skip the file if `reset' tells us to.
1988         (main): If open fails because the file is a directory, and if we're
1989         skipping directories, don't report an error.
1990         Remove special case for DOS and Windows.
1991
1992         * src/dosbuf.c (guess_type): Use the same method for guessing whether a
1993         file is binary as grep.c's grep does.
1994         There's no longer any need to declare `bp' to be unsigned.
1995
1996 1998-04-26 Alain Magloire
1997
1998         * grep-2.2 release.
1999
2000         * src/dfa.c: Wrong revision was pulled out
2001         for beta 2.1.1d.
2002         * src/search.c: Wrong revision was pulled out
2003         for beta 2.1.1d.
2004
2005         * src/grep.c: ck_atoi () added instead of atoi ().
2006         Suggestion from Jim Meyering.
2007         ck_atoi () pulled from diffutils-2.7, maintained by Paul Eggert.
2008
2009         * AUTHORS: Rephrase of some sentences.
2010         * README:  Rewording.
2011         Noted and patched by Joel N. Weber II.
2012
2013 1998-04-17 Kaveh R. Ghazi
2014
2015         * src/dfa.h: Don't define `const', trust autoconf to handle it.
2016
2017 1998-04-16 Alain Magloire
2018
2019         * tests/{status,empty}.sh: wrong return status.
2020
2021         * src/grep.c: Remove the REGEX part in usage (), it was
2022         consider overkill by most.
2023
2024 1998-04-14  Eli Zaretskii
2025
2026         * djgpp/config.bat: Support file names with multiple dots on all
2027         platforms.
2028
2029         * djgpp/README: Add instructions about file names illegal on
2030         MS-DOS.
2031
2032 1998-04-13 Alain Magloire
2033
2034         * src/dfa.c: by "popular" demand reverse
2035         back to '_' not word-constituent.
2036
2037         * grep-2.1.1c available for testing.
2038
2039 1998-04-13  Karl Heuer
2040
2041         * src/grep.c: (a) The directory check is done too early:
2042         logically, if the argument is "-", then it refers to standard
2043         input, regardless of whether there's something in the file
2044         system answering to "-".
2045         (b) The sh command "grep -l root /etc/passwd /etc/group 0<&-"
2046         prints "(standard input)" instead of "/etc/passwd", because it
2047         mistakenly believes that a named file will never be opened on fd
2048         0.  The string "(standard input)" should be based on the file
2049         having been originally specified as "-", rather than making
2050         assumptions about the fd.
2051         (c) the code that calls close(fd) is being done outside of the
2052         test for a bad fd.  Thus, if the open failed, this code will
2053         attempt to close(-1).  It should be done inside the "fd != -1"
2054         branch.
2055         This patch addresses all three of these problems.
2056
2057 1998-04-13 Alain Magloire
2058
2059         * configure.in: remove the deprecated AC_ISC_POSIX macro.
2060         Spotted by Karl Heuer.
2061
2062 1998-04-03  Eli Zaretskii
2063
2064         * djgpp/main.mak, djgpp/src.mak, djgpp/tests.mak: Updated from the
2065         relevant Makefile.in files.
2066
2067         * djgpp/config.bat: Create files in intl directory like the
2068         configure script does.
2069
2070 1998-03-28  Eli Zaretskii
2071
2072         * djgpp/main.mak, djgpp/src.mak, djgpp/tests.mak: Updated to track
2073         changes in respective Makefile.in files.
2074
2075         * src/dosbuf.c (guess_type): Avoid running off the end of the
2076         buffer.  Spotted by Paul Eggert.
2077
2078 1998-03-27  Alain Magloire
2079
2080         * grep-2.1.1b.tar.gz available.
2081
2082         * src/regex.c: CLASS_CHAR_MAX set to 256 instead of 6
2083         when WCTYPE and WCHAR are not defined. When class names
2084         where bigger then 6, it will not detect an error.
2085         example '[[:alphabet:]]'.
2086
2087         * Updated the copyright of the files with emacs.
2088         With emacs Jim :).
2089
2090 1998-03-26 Jim Meyering
2091
2092         * src/dfa.c (IS_WORD_CONSTITUENT): Define.
2093         (lex): Use IS_WORD_CONSTITUENT, not ISALNUM.
2094         Don't special-case '_'.
2095         (dfastate): Use IS_WORD_CONSTITUENT, not ISALNUM.
2096         (dfaexec): Likewise.
2097
2098 1998-03-25  Alain Magloire
2099
2100         * tests/warning.sh: typos and replace the echos with
2101         a simple cat.
2102         Noted By Jim Meyering.
2103
2104         * src/regex.c: #undef ISASCII and ISPRINT before defining
2105         them(On Solaris it was define).
2106         Pattern 'a[[:]:]]b' is an invalid char class and the error
2107         from regex was 1(REG_NOMATCH) instead of 2 (REG_ECTYPE).
2108         Fix with help from Ulrich Drepper.
2109
2110         * src/grep.c (usage): Ulrich wrote: "A single printf should
2111         not have more than 900 bytes. For translation reasons the
2112         text shouldn't be split in too many pieces since this is
2113         tiresome and also does not help to generate a consistent picture."
2114         Noted by Ulrich Drepper.
2115         * src/grep.c (usage): Dig out and old patch from
2116         Franc,ois to explain the regex in usage().
2117         Ideas from Franc,ois Pinard.
2118
2119 1998-03-23 Alain Magloire
2120
2121         * testing: grep-2.1.1a for testing.
2122
2123         * configure.in: Solaris needs '-lw' if we use wchar/wctype
2124         functions.
2125         * src/btowc.c: New file from GNU libc. Solaris 2.5 don't
2126         have it define.
2127         * configure.in : check for btowc ().
2128
2129         * regex.c: Include <wchar.h> before <wctype.h>, to work around
2130         a Solaris 2.5 bug.
2131         Patch provided by Paul Eggert.
2132
2133         * tests/status.sh: new file to check return status code.
2134         * tests/empty.sh: new file to check for empty pattern.
2135         * tests/warning.sh: new file to tell where to report errors.
2136
2137         * configure.in: If available, prefer support for large files
2138         unless the user specified one of the CPPFLAGS, LDFLAGS, or LIBS
2139         variables.
2140         Done by Paul Eggert.
2141
2142         * src/grep.c (usage): change prep.ai.mit.edu for gnu.org.
2143
2144 1998-03-18 Alain Magloire
2145
2146         * src/grep.c (usage): Formating the --help message a bit off.
2147         Noted by William Bader.
2148
2149         * src/grep.c (main): When checking conflicting matcher for option -E the
2150         matcher was to "egrep" instead of "posix-egrep".
2151         Reported by kwzh@gnu.org.
2152
2153         * src/grep.c: Typos and rewording the --help message.
2154         Reported by Karl Heuer.
2155
2156         * src/grep.1: The man page wording :
2157           A regular expression matching a single character may be
2158           followed by one of several repetition operators:
2159         is unclear since 'x(yz)*z' is a valid regex.
2160         Remove the "matching a single character".
2161         Suggested by Harald Hanche-Olsen.
2162
2163         * src/grep.c (main): `-f /dev/null' now specifies no patterns
2164         and therfore matches nothing.
2165         Reported by Jorge Stolfi.
2166         Patched by Paul Eggert.
2167
2168 1998-03-10 Alain Magloire
2169
2170         * Ice storm 98(el nino). Lost grep repository disk,
2171         and my $HOME directory, etc ..
2172         Trying to get the emails/patch from dejanews.com
2173         and start from grep-2.1.
2174         sigh ....
2175
2176 1997-11-01 Alain Magloire
2177
2178         * src/grep.c: For the long options, the problems are:
2179         --file appears in the option table as 'no_argument'
2180         instead of 'required_argument'.
2181         --files-with-matches is missing from the option table.
2182         The help lists '--fixed-strings' as the long option for -F,
2183         the table has '--fixed-regexp'.
2184         --regexp appears in the option table as 'no_argument'
2185         instead of 'required_argument'.
2186         --with-filename is missing from the option table.
2187         Reported by Grant McDorman and Krishna Sethuraman.
2188
2189 1997-10-19 Alain Magloire
2190
2191         * src/grep.c: the option "with-filename was not in the arg table.
2192         Corrected by Jim Hand.
2193
2194         * GNU gettext library from gettext-0.10.32.
2195
2196         * src/grep.c: reverse back to greping directories,
2197         One could skip the error message by defining
2198         SKIP_DIR_ERROR. There is no clear way of doing
2199         things, I hope to setle this on the next majore release
2200         Thanks Paul Eggert, Eli Zaretskii and gnits for the
2201         exchange.
2202
2203         * tests/status.sh: add this check to make sure
2204         That the return status code is ok.
2205
2206 1997-10-10 Andreas Schwab
2207
2208         * src/grep.1: Fix formatting.
2209
2210         * configure.in: Check for wctype.h, wchar.h, libintl.h and
2211         isascii, which are needed for regex.c.
2212
2213 1997-10-01 Paul Eggert
2214
2215         * src/grep.c (fillbuf): Don't warn about mmap failures.
2216
2217 1997-09-7 Alain Magloire
2218
2219         * src/grep.c: added code for -H --with-filename.
2220
2221         * djgpp/*: patch wrongly apply
2222         duplication of text in djgpp/{README,config.h}.
2223         Filter djgpp/config.bat with unix2dos.
2224
2225         * djgpp/make.mak: beautify
2226         From Eli Zaretskii.
2227
2228         * grep-2.1 release.
2229
2230 1997-09-01 Alain Magloire
2231
2232         * grep-2.0f out for testing.
2233
2234         * update to GNU gettext library from gettext-0.10.31
2235
2236         * grep.c : have a nicer format for --version.
2237         Noted by Ulrich Drepper.
2238
2239         * obstack.[ch]: updated from GNU C library
2240         * configure.in: look for stdlib.h [HAVE_STDLIB_H]
2241         Comments from Ulrich Drepper.
2242
2243 1997-08-25 Philippe De Muyter  <phdm@info.ucl.ac.be>
2244
2245         * src/dfa.c (sys/types.h): File included unconditionnaly.
2246
2247 1997-08-16  Eli Zaretskii  <eliz@is.elta.co.il>
2248
2249         * grep.c (long_options) [O_BINARY]: Add DOS-specific options.
2250         (fillbuf) [O_BINARY]: For DOS-style text files, strip CR
2251         characters at end of line.
2252         (prline) [O_BINARY]: Report correct byte offsets, even though CR
2253         characters were stripped when reading the file.
2254         (usage) [O_BINARY]: Add DOS-specific options.
2255         (setmatcher) [HAVE_SETRLIMIT]: Set re_max_failures so that the
2256         matcher won't ever overflow the stack.
2257         (main) [__MSDOS__, _WIN32]: Handle backslashes and drive letters
2258         in argv[0], remove the .exe suffix, and downcase the prgram name.
2259         [O_BINARY]: Pass additional DOS-specific options to getopt_long
2260         and handle them.  Call stat before attempting to open the file, in
2261         case it is a directory (DOS will fail the open call for
2262         directories).  Switch the input descriptor to binary mode, unless
2263         it is a terminal device.
2264
2265         * system.h [O_BINARY]: Define macros to switch a handle to binary
2266         mode, so binary files could be grep'ed on MS-DOS and MS-Windows.
2267         [HAVE_SETLOCALE]: Test for HAVE_SETLOCALE instead of
2268         HAVE_LC_MESSAGES, to prevent compilation error in grep.c on
2269         systems which don't define HAVE_LC_MESSAGES, but have setlocale.
2270
2271         * dosbuf.c: New file, functions specific for MS-DOS/MS-Windows.
2272         (guess_type, undossify_input, dossified_pos): New functions.
2273
2274         * djgpp/config.h, djgpp/config.bat, djgpp/main.mak, djgpp/src.mak,
2275         djgpp/po.mak, djgpp/intl.mak, djgpp/tests.mak, djgpp/po2tbl.sed:
2276         New files, for building Grep with DJGPP tools for MS-DOS and
2277         MS-Windows.
2278
2279         * grep.1: Document DOS-specific switches.
2280
2281 1997-08-08 Alain Magloire
2282
2283         * grep-2.0e: available for testing
2284
2285         * grep.c: change LC_MESSAGE to LC_ALL for (LC_CTYPE).
2286         Suggested by Jochen Hein.
2287
2288         * ABOUT-NLS: updated.
2289         * grep.c: --version: more verbosity (COPYRIGHT).
2290         * grep.c: --help: PATTERN, FILE instead of <pattern>, <file>.
2291         * INSTALL.grep: not necessary removed.
2292         * configure.in: --disable-regex rename --without-include-regex.
2293         * THANKS: format: first row name, second email.
2294         * ChangeLog: format ISO 8601.
2295         Reported by Franc,ois Pinard.
2296
2297         * grep.c: move dcl of struct stat st into "else" where it's used.
2298         Reported by Jim Meyering.
2299
2300         * grep.c: totalnl should be %u in printf.
2301         Reported by Michael Aichlmay
2302         Corrected with guidance from Ulrich Drepper
2303
2304 1997-07-24 Alain Magloire <alainm@rcsm.ee.mcgill.ca>
2305
2306         * Makefile.am: corrected an error when installing {f,e}grep.1.
2307         From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
2308         From Ulrich Drepper <drepper@cygnus.com>.
2309
2310         * Many files: use PARAMS instead of __STDC__ for prototypes.
2311         From Jim Meyering <meyering@eng.ascend.com>.
2312         Patch provided by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
2313
2314         * dfa.[ch]: uses the one in gawk-3.0.3 with the patch from
2315         Arnold (see Changelog: July 12 1997)
2316
2317         * grep.1: a note to say -l, -L, -q stop on first match.
2318         Noted by Andrew Beattie <gaffer@tug.com>.
2319
2320         * grep.c: refuse to scan if the file is a directory.
2321         This was causing problems on SUNs. If the directory contains
2322         a file that could match the pattern, garbage was display.
2323
2324         * tests directory: added new set of tests from Henry Spencer
2325         regex package. Change the way the tests were done to be more
2326         conformant to automake.
2327
2328         * configure.in: added --disable-regex for folks with their own fuctions.
2329
2330         * grep-20d : available for testing
2331
2332 1997-07-18 Alain Magloire <alainm@rcsm.ee.mcgill.ca>
2333
2334         * grep-2.0c: available for testing
2335
2336 1997-07-17 Alain Magloire <alainm@rcsm.ee.mcgill.ca>
2337
2338         * src/grep.c: Cause grep to fail if `fclose (stdout)' fails.
2339         From Jim Meyering <meyering@eng.ascend.com>.
2340
2341         * grep.c:usage() more consistency in the --help.
2342
2343         * egrep, fgrep were links This is in violation of GNU standards:
2344         "Please don't make the behavior of a utility depend on the name used
2345         to invoke it.  It is useful sometimes to make a link to a utility with
2346         a different name, and that should not change what it does."
2347         For now egrep and fgrep will be copies of grep. A better scheme
2348         should be found later.
2349         After discussion with Tom Tromey <tromey@cygnus.com>.
2350
2351         * fgrep.man and egrep.man included: They are stubs that call grep.1.
2352         * Makefile.am: modified to install {f,e,}grep[,.1].
2353
2354         * speed hack for -l, -L: bail out on first match.
2355         From Scott Weikart <scott@igc.apc.org>.
2356
2357         * *.[ch]: provided prototypes for strict argument checking
2358         With the help of Stewart Levin <stew@sep.stanford.edu>.
2359
2360 1997-07-16 Alain Magloire <alainm@rcsm.ee.mcgill.ca>
2361
2362         * configure.in: typo in the creation of po/Makefile
2363         Noted by Volker Borchert bt@teknon.de.
2364
2365         * grep-2.0b: make it available for testing.
2366
2367 1997-07-15 Alain Magloire <alainm@rcsm.ee.mcgill.ca>
2368
2369         * src/grep.c usage(): cut the --help in smaller printf()'s
2370         Noted by Ulrich Drepper <drepper@cygnus.com>.
2371
2372 1997-07-14 Alain Magloire <alainm@rcsm.ee.mcgill.ca>
2373
2374         * grep-2.0a: make an alpha available for testing.
2375
2376 1997-07-12 Alain Magloire <alainm@rcsm.ee.mcgill.ca>
2377
2378         * run gettextize: added the po directory filled with *.po files.
2379
2380         * check.sh, scriptgen.awk: fix grep paths.
2381
2382         * change the directory strucure: grep is now in src to comply with
2383         gettext.m4.
2384
2385         * grep.c version.c [VERSION]: got rid of version.c,
2386         it is now define via config.h.
2387
2388         * dfa.c: patch to speed up initialization.
2389         Arnold Robbins (arnold@gnu.ai.mit.edu).
2390
2391 1997-07-09 Alain Magloire <alainm@rcsm.ee.mcgill.ca>
2392
2393         * *.c [HAVE_CONFIG_H]: Macro defined.
2394
2395         * support for I18N in Makefile.am and configure.in.
2396
2397         * update all the string to use gettext(I18N).
2398         Help from Franc,ois Pinard previous patch <pinard@IRO.UMontreal.CA>.
2399
2400 1997-07-04 Alain Magloire <alainm@rcsm.ee.mcgill.ca>
2401
2402         * obstack.[ch]: updated from glibc.
2403         Work of Ulrich Drepper <drepper@cygnus.com>.
2404
2405         * regex.[ch]: updated from glibc.
2406         Work of Ulrich Drepper <drepper@cygnus.com>.
2407
2408         * grep.c: for option -e not counting '\n' for new keys.
2409         From Mark Waite <markw@mddmew.fc.hp.com>.
2410
2411         * grep.c: for option -f allocating the right count.
2412         From Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
2413         Mike Heartel (mike@cs.uoregon.edu).
2414
2415         * kwset.c (bmexec): Cast tp[-2] to unsigned char before comparing.
2416         From Jim Meyering <meyering@asic.sc.ti.com>.
2417
2418         * grep.1: various typos.
2419         From Keith Bostic <bostic@bsdi.com>.
2420         Mike Heartel (mike@cs.uoregon.edu).
2421
2422 1997-06-17 Alain Magloire <alainm@rcsm.ee.mcgill.ca>
2423
2424         * grep.c: support for long options.
2425         patch done by Franc,ois Pinard <pinard@IRO.UMontreal.CA>.
2426
2427         * add getopt1.c in Makefile.am.
2428         Noted by Franc,ois Pinard <pinard@IRO.UMontreal.CA>
2429
2430         * replace getopt.[ch] and add getopt1.c.
2431
2432         * kwset.c: undef malloc before define it.
2433         Franc,ois Pinard <pinard@IRO.UMontreal.CA>.
2434
2435 1997-06-07 Alain Magloire <alainm@rcsm.ee.mcgill.ca>
2436
2437         * grep.c: format incorrect in
2438         fprintf("%s: warning: %s: %s...", filename, strerror(errno)).
2439         Mike Heartel (mike@cs.uoregon.edu).
2440
2441 1996-11-19  David J MacKenzie  <djm@catapult.va.pubnix.com>
2442
2443         * make.com: Set the logical SYS. From rdb@cocamrd.oz.au (Rodney Brown).
2444
2445         * grep.c (S_ISREG): Define if not defined already, for e.g.
2446         SunOS 4.0.3.
2447
2448         * dfa.c (test_bit, set_bit, clear_bit): Renamed from tstbit,
2449         setbit, clrbit to avoid conflict with HP-UX sys/param.h macros.
2450
2451         * memchr.c: New file, from GNU libc.
2452         * grep.c (memchr): Remove definition.
2453         * configure.in: Use AC_REPLACE_FUNCS for memchr.
2454
2455         * configure.in: Remove unused checks for memalign and unsigned char.
2456         * grep.c: HAVE_WORKING_MMAP -> HAVE_MMAP.
2457
2458         * system.h: New file.
2459         * dfa.c, kwset.c, grep.c, search.c: Use it instead of duplicating
2460         portability boilerplate.
2461
2462         * grep.c: Include sys/types.h once, instead of three times
2463         conditionally.
2464         * dfa.c, kwset.c, search.c: Include sys/types.h unconditionally,
2465         to always try to get size_t (needed on some old SysV's).
2466
2467         * dfa.c: Define strchr in terms of index, not the other way around.
2468         * search.c: Use memcpy instead of bcopy.
2469
2470 1996-11-15  David J MacKenzie  <djm@catapult.va.pubnix.com>
2471
2472         * Many files: Update FSF address.
2473         Update configuration to use autoconf v2 and automake.
2474
2475 1993-05-22  Mike Haertel  <mike@cs.uoregon.edu>
2476
2477         * Version 2.0 released.