1131554Stjr2002-03-26 Bernhard Rosenkraenzer <bero@redhat.com> 2131554Stjr * src/grep.c: Don't fail if we don't have an stdout fd and -q 3131554Stjr is used (happens e.g. on calls from hotplug scripts) 4131554Stjr * src/grep.c: Don't hang forever if fed with an empty string to 5131554Stjr grep for and --color enabled 6131554Stjr * src/grep.c: Fix infinite loop on 7131554Stjr echo "1 one" | grep -E "[0-9]*" -o 8131554Stjr echo "1 one" | grep -E "[0-9]*" --color 9131554Stjr * po/*: Sync wiith translation project 10131554Stjr * src/grep.c, src/Makefile.am, configure.in: Add patch from 11131554Stjr Paul Eggert <eggert@twinsun.com> to comply with ridiculous 12131554Stjr guidelines (don't act differently if invoked as egrep or fgrep) 13131554Stjr * configure.in: Bump version number, require a recent autoconf 14131554Stjr 15131554Stjr2002-03-14 Bernhard Rosenkraenzer <bero@redhat.com> 16131554Stjr * src/Makefile.am, po/Makefile.in.in: Support DESTDIR properly 17131554Stjr * tests/bre.tests: Add fix from 18131554Stjr Peter Breitenlohner <peb@mppmu.mpg.de> 19131554Stjr 20131554Stjr2002-03-13 Bernhard Rosenkraenzer <bero@redhat.com> 21131554Stjr * configure.in, m4/regex.m4, m4/malloc.m4, m4/realloc.m4: 22131554Stjr Don't set LIBOBJS directly, autoconf 2.53 doesn't like it 23131554Stjr * intl/*: Sync with gettext 0.11 24131554Stjr * po/*: Sync with translation project 25131554Stjr * configure.in, src/Makefile.am: Don't duplicate code - make 26131554Stjr egrep and fgrep links to grep and set matcher based on 27131554Stjr application name, suggestion from 28131554Stjr Guillaume Cottenceau <gc@mandrakesoft.com> 29131554Stjr * src/grep.c: (prline) Add fix for -i --color from 30131554Stjr Jim Meyering <meyering@lucent.com> 31131554Stjr * configure.in: Version 2.5; release 32131554Stjr 33131554Stjr2002-01-23 Bernhard Rosenkraenzer <bero@redhat.com> 34131554Stjr * configure.in: Version 2.5g 35131554Stjr * Makefile.cvs, grep.spec: Add packaging tools 36131554Stjr Merge djgpp changes from Andrew Cottrell <anddjgpp@ihug.coml.au>: 37131554Stjr * src/grep.c: Added conditional compilation for DJGPP 38131554Stjr * djgpp: remove directory as it is no longer required with DJGPP 2.03 39131554Stjr (or 2.04 when released) 40131554Stjr * README.DOS: Moved djgpp/readme to readme.dos 41131554Stjr * PATCHES.AC, PATCHES.AM: delete files - redundant 42131554Stjr * configure.in, Makefile.am: remove djgpp directory from list 43131554Stjr 44131554Stjr2002-01-22 Bernhard Rosenkraenzer <bero@redhat.com> 45131554Stjr * doc/grep.texi, doc/grep.1, NEWS: Document --label 46131554Stjr * po/ru.po: Sync with translation project 47131554Stjr * po/grep.pot: Sync with source 48131554Stjr 49131554Stjr2002-01-18 Bernhard Rosenkraenzer <bero@redhat.com> 50131554Stjr * src/grep.c: Add --label, based on patch from Stepan Koltsov 51131554Stjr 52131554Stjr2001-11-20 Bernhard Rosenkraenzer <bero@redhat.com> 53131554Stjr * autogen.sh: Don't hardcode aclocal dir 54131554Stjr 55131554Stjr2001-11-19 Bernhard Rosenkraenzer <bero@redhat.com> 56131554Stjr * src/grep.c: Add --only-matching (-o) switch (see NEWS) 57131554Stjr * doc/grep.texi, doc/grep.1, NEWS: Document changes 58131554Stjr * configure.in, lib/Makefile.am: Don't use internal getopt if 59131554Stjr we're on a system that provides a working getopt function 60131554Stjr 61131554Stjr2001-09-25 Bernhard Rosenkraenzer <bero@redhat.com> 62131554Stjr * configure.in: Detect pcre correctly even when it's in 63131554Stjr non-standard locations, using pcre-config 64131554Stjr * src/grep.c: Add --color={always,never,tty} argument (like in ls) 65131554Stjr * src/grep.c: Turn off blinking in the default colorization 66131554Stjr * src/grep.c: Add --devices (-D) switch (analogous to --directories) 67131554Stjr * src/dfa.c: Fix an i18n bug: echo "A" | grep '[A-Z0-9]' wouldn't work 68131554Stjr in non-C-Locales on systems using current versions of glibc. 69131554Stjr * AUTHORS: Change maintainer, credit Alain for his work until now 70131554Stjr * configure.in, m4/decl.m4, m4/dosfile.m4, m4/gettext.m4, 71131554Stjr m4/init.m4, m4/install.m4, m4/largefile.m4, m4/lcmessage.m4, 72131554Stjr m4/header.m4, m4/isc-posix.m4, m4/missing.m4, m4/progtest.m4, 73131554Stjr m4/sanity.m4: 74131554Stjr Fix build with autoconf 2.5x, retain 2.1x compatibility for now 75131554Stjr * autogen.sh: Add some crude hacks to make it possible to build with 76131554Stjr both autoconf 2.5x and 2.1x 77131554Stjr * acconfig.h: removed (no longer required) 78131554Stjr * Makefile.am: add cvs-clean target 79131554Stjr * doc/grep.texi, doc/grep.1, NEWS: Document changes 80131554Stjr (--color, --devices, -D) 81131554Stjr * src/dfa.c, src/grep.c: Add vim modelines 82131554Stjr 83131554Stjr2001-08-30 Alain Magloire 84131554Stjr 85131554Stjr * configure.in: Add gl in ALL_LINGUAS. 86131554Stjr 87131554Stjr2001-08-30 Kurt D Schwehr 88131554Stjr 89131554Stjr * doc/grep.1: Warn that grep insert a "--" between groups of matches, 90131554Stjr when using the context options. 91131554Stjr * doc/grep.texi: Likewised. 92131554Stjr 93131554Stjr2001-08-25 Heikki Korpela 94131554Stjr 95131554Stjr * doc/grep.texi: Point out that some Platforms do not support 96131554Stjr reading of directories and silently ignore them. 97131554Stjr 98131554Stjr2001-08-21 Alain Magloire 99131554Stjr 100131554Stjr * lib/malloc.c: New file: 101131554Stjr * lib/realloc.c: New file: 102131554Stjr * lib/Makefile.am: Add malloc.c and realloc.c in EXTRA_DIST. 103131554Stjr 104131554Stjr2001-07-31 Alain Magloire 105131554Stjr 106131554Stjr * po/*.po: New files from the translation team: 107131554Stjr grep-2.5e.de.po grep-2.5e.el.po grep-2.5e.eo.po grep-2.5e.es.po 108131554Stjr grep-2.5e.et.po grep-2.5e.fr.po grep-2.5e.gl.po grep-2.5e.it.po 109131554Stjr grep-2.5e.pl.po grep-2.5e.sl.po 110131554Stjr 111131554Stjr2001-07-31 Andreas Schwab 112131554Stjr 113131554Stjr * src/grep.c: Fix all uses of error to pass a proper format 114131554Stjr string. 115131554Stjr 116131554Stjr2001-07-29 Alain Magloire 117131554Stjr 118131554Stjr * grep/src/grep.c (usage): Typos corrected. 119131554Stjr Patches from Santiago Vila. 120131554Stjr 121131554Stjr2001-07-29 Alain Magloire 122131554Stjr 123131554Stjr David Clissold, wrote: 124131554Stjr a small bug in the GNU grep 2.4.2, which may have gone unnoticed 125131554Stjr because it only causes a failure if building on a system with large 126131554Stjr files enabled (e.g. an "off_t" is a "long long" rather than a "long"). 127131554Stjr savedir() takes on off_t argument, but in grepdir() the parameter 128131554Stjr is cast to an (unsigned). Well, if an off_t is larger than an int, 129131554Stjr the value gets truncated. This would not normally have an effect on a 130131554Stjr little-endian platform (unless the file is >2GB), but on a big-endian 131131554Stjr system it will always fail. The external effect is that 132131554Stjr "grep -r foo dir_name" fails with ENOMEM (from malloc() within 133131554Stjr savedir()). 134131554Stjr 135131554Stjr * grep/src/grep.c (grepdir): Remove the (unsigned) cast when calling 136131554Stjr savedir(). 137131554Stjr Patch from David Clissold. 138131554Stjr 139131554Stjr2001-07-29 Alain Magloire 140131554Stjr 141131554Stjr * grep/doc/grep.texi: In Bugs report use {n,m} for consistency. 142131554Stjr * grep/doc/grep.1: Likewised. 143131554Stjr Noted by Steven Lucy. 144131554Stjr 145131554Stjr2001-04-27 Isamu Hasegawa 146131554Stjr 147131554Stjr * dfa.c (mblen_buf) : New variable contains the amount of remain 148131554Stjr byte of corresponding multibyte character in the input string. 149131554Stjr (SKIP_REMAIN_MB_IF_INITIAL_STATE) : Use mblen_buf. 150131554Stjr (match_anychar) : Use mblen_buf. 151131554Stjr (match_mb_charset) : Use mblen_buf. 152131554Stjr (transit_state_consume_1char) : Use mblen_buf. 153131554Stjr (transit_state) : Use inputwcs to get current (multibyte) character. 154131554Stjr (dfaexec) : Add initialization of mblen_buf. 155131554Stjr 156131554Stjr2001-04-27 Isamu Hasegawa 157131554Stjr 158131554Stjr * dfa.c (addtok) : Set appropriate value to multibyte_prop. 159131554Stjr (dfastate) : Add the initialization of the variable. 160131554Stjr (dfaexec) : Call transit_state if d->fail may transit by 161131554Stjr multibyte characters. 162131554Stjr (transit_state_singlebyte) : Clean up unnecessary code. 163131554Stjr (transit_state_consume_1char) : Likewise. 164131554Stjr (transit_state) : Add checking for word and newline. 165131554Stjr 166131554Stjr2001-04-19 Isamu Hasegawa 167131554Stjr 168131554Stjr * search.c (check_multibyte_string) : Check the case when mbclen == 0. 169131554Stjr 170131554Stjr2001-04-11 Isamu Hasegawa 171131554Stjr 172131554Stjr * search.c (check_multibyte_string) : Check the head of multibyte 173131554Stjr characters, and optimize a bit. 174131554Stjr (EGexecute) : Optimize a bit. 175131554Stjr (Fexecute) : Fix the index. 176131554Stjr 177131554Stjr2001-04-02 Alain Magloire 178131554Stjr 179131554Stjr * lib/regex.c: Update from GNU lib C, with the changes 180131554Stjr provided by Paul Eggert. 181131554Stjr * lib/posix/regex.h: Likewise. 182131554Stjr 183131554Stjr2001-02-17 Paul Eggert 184131554Stjr 185131554Stjr Stop trying to support hosts that have nonstandard declarations for 186131554Stjr mbrtowc and/or mbstate_t. It's not worth the portability hassle. 187131554Stjr 188131554Stjr * lib/quotearg.c (mbrtowc, mbsinit): Remove workaround macros 189131554Stjr for hosts that have mbrtowc but not mbstate_t, as we now 190131554Stjr insist on proper declarations for both before using mbrtowc. 191131554Stjr 192131554Stjr2001-03-18 Alain Magloire 193131554Stjr 194131554Stjr * configure.in: Call AC_MBSTATE_T. 195131554Stjr * Makefile.am: Add mbstate_t.m4 196131554Stjr * m4/Makefile.am: Add mbstate_t.m4 197131554Stjr * m4/mbstate_t.m4: New m4 macro. 198131554Stjr * lib/strtol.c: Define CHAR_BITS. 199131554Stjr Uwe H. Steinfeld, Ruslan Ermilov, Volkert Bochert, noted 200131554Stjr that mbstate_t was not define for certain platforms. 201131554Stjr 202131554Stjr2001-03-18 Paul Eggert 203131554Stjr 204131554Stjr * src/grep.c (fillbuf): Fix storage allocation performance 205131554Stjr bug: buffer was doubling in size in many cases where it didn't 206131554Stjr have to. 207131554Stjr 208131554Stjr2001-03-17 Paul Eggert 209131554Stjr 210131554Stjr * src/grep.c (fillbuf): Avoid unnecessary division by 2. 211131554Stjr Don't check xrealloc return value; it's guaranteed to be nonzero. 212131554Stjr (fillbuf, grepdir): Use xalloc_die rather than error; it's shorter. 213131554Stjr 214131554Stjr2001-03-17 Alain Magloire 215131554Stjr 216131554Stjr * src/grep.c (context_length_arg): error () passing wrong format. 217131554Stjr Spotted by Jim Meyering. 218131554Stjr 219131554Stjr2001-03-07 Alain Magloire 220131554Stjr 221131554Stjr * README-alpha: Removed reference to GNU tar, add the location 222131554Stjr of the CVSROOT. 223131554Stjr 224131554Stjr2001-03-06 Alain Magloire 225131554Stjr 226131554Stjr Only the Regex patterns should be split in an array, patterns[]. 227131554Stjr The dfa and KWset compiled patterns should remain global and the 228131554Stjr patterns compiled all at once. 229131554Stjr 230131554Stjr * src/search.c: include "error.h" and "xalloc.h" to get prototyping 231131554Stjr of x*alloc() and error(). 232131554Stjr (kwsinit): Reverse to previous behaviour and takes no argument. 233131554Stjr (kwsmusts): Likewised. 234131554Stjr (Gcompile): For the regex pattern, split them and each pattern 235131554Stjr is put in different compiled structure patterns[]. The patterns 236131554Stjr are given to dfacomp() and kwsmusts() as is. 237131554Stjr (Ecompile): Likewised. 238131554Stjr (Fcompile): Reverse to the old behaviour of compiling the enire 239131554Stjr patterns in one shot. 240131554Stjr (EGexecute): If falling to GNU regex for the matching, loop in the 241131554Stjr array of compile patterns[] to find a match. 242131554Stjr (error): Many error () were call with arguments in the wrong order. 243131554Stjr * tests/file.sh: Simple test to check for pattern in files. 244131554Stjr 245131554Stjr Reaction to bug report fired by Greg Louis <glouis@dynamicro.on.ca> 246131554Stjr 247131554Stjr2001-03-06 Isamu Hasegawa 248131554Stjr 249131554Stjr In multibyte environments, handle multibyte characters as single 250131554Stjr characters in bracket expressions. 251131554Stjr 252131554Stjr * src/dfa.h (mb_char_classes) : new structure. 253131554Stjr (mbcsets): new variable. 254131554Stjr (nmbcsets): new variable. 255131554Stjr (mbcsets_alloc) : new variable. 256131554Stjr * src/dfa.c (prtok) : handle MBCSET. 257131554Stjr (fetch_wc): new function to fetch a wide character. 258131554Stjr (parse_bracket_exp_mb) : new function to handle multibyte character 259131554Stjr in lex(). 260131554Stjr (lex): invoke parse_bracket_exp_mb() for multibyte bracket expression. 261131554Stjr (atom): handle MBCSET. 262131554Stjr (epsclosure): likewise. 263131554Stjr (dfaanalyze): likewise. 264131554Stjr (dfastate): likewise. 265131554Stjr (match_mb_charset): new function to judge whether a bracket match 266131554Stjr with a multibyte character. 267131554Stjr (check_matching_with_multibyte_ops) : handle MBCSET. 268131554Stjr (dfainit): initialize new variables. 269131554Stjr (dfafree): free new variables. 270131554Stjr 271131554Stjr2001-03-04 Alain Magloire 272131554Stjr 273131554Stjr To get more in sync with other GNU utilities like GNU tar and fetish 274131554Stjr all the supporting functions are now under lib. 275131554Stjr Thanks to Jim Meyering, Volkert Bochert and Paul Eggert for 276131554Stjr the code and the reminders. 277131554Stjr 278131554Stjr * src/grep.c (fatal): Function removed, using error () from 279131554Stjr lib/error.c instead. 280131554Stjr (usage): Copyright updated. 281131554Stjr (error): Function removed, using error () from lib/error.c instead, 282131554Stjr adjust prototypes. 283131554Stjr (prog): Global variable rename to program_name, to work with new 284131554Stjr lib/error.c. 285131554Stjr (xrealloc): Removed using lib/xmalloc.c. 286131554Stjr (xmalloc): Removed using lib/xmalloc.c 287131554Stjr (main): Register with atexit() to check for error on stdout. 288131554Stjr * configure.in: Check for atexit(), call jm_MALLOC, jm_RELLOC and 289131554Stjr jm_PREREQ_ERROR. 290131554Stjr * tests/bre.awk: Removed the hack to drain the buffer since we 291131554Stjr always fclose(stdout) atexit. 292131554Stjr * tests/ere.awk: Likewise. 293131554Stjr * tests/spencer1.awk: Likewise. 294131554Stjr * bootstrap/Makefile.try: Update the Makefile to reflect the changes 295131554Stjr in the new hierarchy. 296131554Stjr 297131554Stjr * README-alpha: New File. 298131554Stjr * m4/realloc.m4: New File. 299131554Stjr * m4/malloc.m4: New File. 300131554Stjr * m4/error.m4: New File. 301131554Stjr * m4/Makefile.am: Updated. 302131554Stjr * lib: New directory. 303131554Stjr * lib/Makefile.am: New file. 304131554Stjr * lib/closeout.c: New file. 305131554Stjr * lib/closeout.h: New file. 306131554Stjr * lib/fnmatch.c: New file. 307131554Stjr * lib/fnmatch.h: New file. 308131554Stjr * lib/atexit.c: New file. 309131554Stjr * lib/error.c: New file. 310131554Stjr * lib/error.h: New file. 311131554Stjr * lib/quotearg.h: New file. 312131554Stjr * lib/quotearg.c: New file. 313131554Stjr * lib/xmalloc.c: New file. 314131554Stjr * lib/posix: New directory. 315131554Stjr * lib/posix/Makefile.am: New file. 316131554Stjr * src/getopt.c: Moved to lib. 317131554Stjr * src/getopt1.c: Moved to lib. 318131554Stjr * src/getopt.h: Moved to lib. 319131554Stjr * src/alloca.c: Moved to lib. 320131554Stjr * src/exclude.c: Moved to lib. 321131554Stjr * src/exclude.h: Moved to lib. 322131554Stjr * src/hard-locale.h: Moved to lib. 323131554Stjr * src/hard-locale.c: Moved to lib. 324131554Stjr * src/isdir.c: Moved to lib. 325131554Stjr * src/mechr.c: Moved to lib. 326131554Stjr * src/obstack.c: Moved to lib. 327131554Stjr * src/obstack.h: Moved to lib. 328131554Stjr * src/regex.c: Moved to lib. 329131554Stjr * src/regex.h: Moved to lib. 330131554Stjr * src/posix: Moved to lib. 331131554Stjr * src/posix/regex.h: Moved to lib. 332131554Stjr * src/savedir.h: Moved to lib. 333131554Stjr * src/savedir.c: Moved to lib. 334131554Stjr * src/stpcpy.c: Moved to lib. 335131554Stjr * src/strtoul.c: Moved to lib. 336131554Stjr * src/strtol.c: Moved to lib. 337131554Stjr * src/strtoull.c: Moved to lib. 338131554Stjr * src/strtoumax.c: Moved to lib. 339131554Stjr * src/xstrtol.c: Moved to lib. 340131554Stjr * src/xstrtol.h: Moved to lib. 341131554Stjr * src/xstrtoumax.c: Moved to lib. 342131554Stjr 343131554Stjr2001-03-01 Isamu Hasegawa 344131554Stjr 345131554Stjr Implement the mechanism to match with multibyte characters, 346131554Stjr and use it for `period' in multibyte environments. 347131554Stjr 348131554Stjr * dfa.h (mbps): new variable. 349131554Stjr * dfa.c (prtok): handle ANYCHAR. 350131554Stjr (lex): use ANYCHAR for `period' in multibyte environments. 351131554Stjr (atom): handle ANYCHAR. 352131554Stjr (state_index): initialize mbps in multibyte environments. 353131554Stjr (epsclosure): handle ANYCHAR. 354131554Stjr (dfaanalyze): handle ANYCHAR. 355131554Stjr (dfastate): handle ANYCHAR. 356131554Stjr (realloc_trans_if_necessary): new function. 357131554Stjr (transit_state_singlebyte): new function. 358131554Stjr (match_anychar): new function. 359131554Stjr (check_matching_with_multibyte_ops): new function. 360131554Stjr (transit_state_consume_1char): new function. 361131554Stjr (transit_state): new function. 362131554Stjr (dfaexec): invoke transit_state if expression can match with 363131554Stjr a multibyte character in multibyte environments. 364131554Stjr (dfamust): handle ANYCHAR. 365131554Stjr 366131554Stjr2001-03-01 Alain Magloire 367131554Stjr 368131554Stjr * src/exclude.c: New file. 369131554Stjr * src/exclude.h: New file. 370131554Stjr * src/grep.c (main): Took the GNU tar code to handle 371131554Stjr the option --include, --exclude, --exclude-from. 372131554Stjr Files are check for a match, with exlude_filename (). 373131554Stjr New option --exclude-from. 374131554Stjr * src/savedir.c: Call exclude_filename() to check for 375131554Stjr file pattern exclusion or inclusion. 376131554Stjr * configure.in: --disable-pcre rename to --disable-perl-regexp. 377131554Stjr 378131554Stjr 379131554Stjr2001-02-25 Alain Magloire 380131554Stjr 381131554Stjr * src/dfa.c: Typo corrected. 382131554Stjr Noted by Isamu Hasegawa. 383131554Stjr * src/savedir.c: Typos corrected. 384131554Stjr 385131554Stjr2001-02-22 Alain Magloire 386131554Stjr 387131554Stjr * src/savedir.c (isdir1): New function, calling isdir with 388131554Stjr the correct pathname. 389131554Stjr 390131554Stjr2001-02-19 Isamu Hasegawa 391131554Stjr 392131554Stjr Avoid incorrect state transition in multibyte environments. 393131554Stjr 394131554Stjr * dfa.h (nmultibyte_prop): new variable. 395131554Stjr (multibyte_prop): new variable. 396131554Stjr * dfa.c (addtok): set inputwcs. 397131554Stjr (dfastate): avoid incorrect state transition in multibyte 398131554Stjr environments. 399131554Stjr (dfaexec): likewise. 400131554Stjr (dfainit): init multibyte_prop. 401131554Stjr (dfafree): free multibyte_prop. 402131554Stjr (inputwcs): new variable. 403131554Stjr 404131554Stjr2001-02-19 Isamu Hasegawa 405131554Stjr 406131554Stjr Handle a multibyte character followed by '*', '+', and '{n,m}' 407131554Stjr correctly. 408131554Stjr 409131554Stjr * dfa.c (update_mb_len_index): new function. 410131554Stjr Support for multibyte string. 411131554Stjr (FETCH): call update_mb_len_index. 412131554Stjr (lex): check cur_mb_index not to misunderstand multibyte characters. 413131554Stjr (atom): make a tree from a multibyte character. 414131554Stjr (dfaparse): initialize new variables. 415131554Stjr (mbs): new variable. 416131554Stjr (cur_mb_len): new variable. 417131554Stjr (cur_mb_index): new variable. 418131554Stjr 419131554Stjr2001-02-18 Jim Meyering 420131554Stjr 421131554Stjr * m4/dosfile.m4 (AC_DOSFILE): Move AC_DEFINEs out of AC_CACHE_CHECK. 422131554Stjr 423131554Stjr2001-02-17 Alain Malgoire 424131554Stjr 425131554Stjr * doc/grep.texi: Document the new options and the new behaviour 426131554Stjr back-references are local. Use excerpt from Karl Berry regex 427131554Stjr texinfo. 428131554Stjr 429131554Stjr * bootstrap/Makefile.try: Added xstrtoumax.o xstrtoul.o hard-local.o 430131554Stjr 431131554Stjr2001-02-17 Alain Magloire 432131554Stjr 433131554Stjr From Guglielmo 'bond' Bondioni : 434131554Stjr The bug was that using a multi line file that contained REs (one per 435131554Stjr line), backreferences in the REs were considered global (to the file) 436131554Stjr and not local (to the line). 437131554Stjr That is, \1 in line n refers to the first \(.\) in the whole file, 438131554Stjr rather than in the line itself. 439131554Stjr 440131554Stjr From Tapani Tarvainen : 441131554Stjr # Re: grep -e '\(a\)\1' -e '\(b\)\1' 442131554Stjr That's not the way it should work: multiple -e arguments 443131554Stjr should be treated as independent patterns and back references 444131554Stjr should not refer to previous ones. 445131554Stjr 446131554Stjr From Paul Eggert : 447131554Stjr GNU grep currently does not issue 448131554Stjr diagnostics for the following two cases, both of which are erroneous: 449131554Stjr grep -e '[' -e ']' 450131554Stjr grep '[ 451131554Stjr ]' 452131554Stjr POSIX requires a diagnostic in both cases because '[' is not a valid 453131554Stjr regular expression. 454131554Stjr 455131554Stjr To overcome those problems, grep no longer pass the concatenate 456131554Stjr patterns to GNU regex but rather compile each patterns separately 457131554Stjr and keep the result in an array. 458131554Stjr 459131554Stjr * src/search.c (patterns): New global variable; a structure array 460131554Stjr holding the compiled patterns. 461131554Stjr Declare function prototypes to minimize error. 462131554Stjr (dfa, kswset, regexbuf, regs): Removed, no longer static globals, but 463131554Stjr rather fields in patterns[] structure per motif. 464131554Stjr (Fcompile): Alloc an entry in patterns[] to hold the regex. 465131554Stjr (Ecompile): Alloc an entry per motif in the patterns[] array. 466131554Stjr (Gcompile): Likewise. 467131554Stjr (EGexecute): Loop through of array of patterns[] for a match. 468131554Stjr 469131554Stjr2001-02-17 Alain Magloire 470131554Stjr 471131554Stjr From Bernd Strieder : 472131554Stjr # tail -f logfile | grep important | do_something_urgent 473131554Stjr # tail -f logfile | grep important | do_something_taking_very_long 474131554Stjr If grep does full buffering in these cases then the urgent operation 475131554Stjr does not happen as it should in the first case, and in the second case 476131554Stjr time is lost due to waiting for the buffer to be filled. 477131554Stjr This is clearly spoken not grep's fault in the first place, but libc's. 478131554Stjr There is a heuristic in libc that make a stream line-buffered only if a 479131554Stjr terminal is on the other end. This doesn't take care of the cases where 480131554Stjr this connection is somehow indirect. 481131554Stjr 482131554Stjr * src/grep.c (line_buffered): new option variable. 483131554Stjr (prline): if line_buffered is set fflush() is call. 484131554Stjr (usage): line_buffered new option. 485131554Stjr Input from Paul Eggert, doing setvbuf() may not be portable 486131554Stjr and breaks grep -z. 487131554Stjr 488131554Stjr2001-02-16 Alain Magloire 489131554Stjr 490131554Stjr Patch from Isamu Hasegawa, for multibyte support. 491131554Stjr This patch prevent kwset_matcher from following problems. 492131554Stjr For example, in SJIS encoding, one character has the codepoint 0x895c. 493131554Stjr So the second byte of the character can match with '\' incorrectly. 494131554Stjr And in eucJP encoding, there are the characters whose codepoints are 495131554Stjr 0xa5b9, 0xa5c8. On the other hand, there is one character whose 496131554Stjr codepoint is 0xb9a5. So 0xb9a5 can match with 2nd byte of 0xa5b9 497131554Stjr and 1st byte of 0xa5c8. 498131554Stjr 499131554Stjr * configure.in: Add check for mbrtowc. 500131554Stjr * src/search.c (check_multibyte_string): new function. 501131554Stjr Support for multibyte string. 502131554Stjr (EGexecute): call check_multibyte_string when kwset is set. 503131554Stjr (Fexecute): call to check_multibyte_string. 504131554Stjr (MBS_SUPPORT): new macro. 505131554Stjr (MB_CUR_MAX): new macro. 506131554Stjr 507131554Stjr2001-02-16 Alain Magloire 508131554Stjr 509131554Stjr * djgpp/config.bat: Fix for 4dos.com. 510131554Stjr * m4/dosfile.m4 (HAVE_DOS_FILE_CONTENTS): Was not set. 511131554Stjr Bugs noted and patched by Juan Manuel Guerrero. 512131554Stjr 513131554Stjr2001-02-16 Alain Magloire 514131554Stjr 515131554Stjr A much requested feature, the possibility to select 516131554Stjr files when doing recurse : 517131554Stjr # find . -name "*.c" | xargs grep main {} 518131554Stjr # grep --include=*.c main . 519131554Stjr # find . -not -name "*.c" | xargs grep main {} 520131554Stjr # grep --exclude=*.c main . 521131554Stjr 522131554Stjr * src/grep.c (short_options): -R equivalent to -r. 523131554Stjr (#ifdef) : Fix some inconsistencies in the use of #ifdefs, prefer 524131554Stjr #if defined() wen possible. 525131554Stjr (long_options): Add --color, --include and exclude. 526131554Stjr (Usage): Description of new options. 527131554Stjr (color): Rename color variable to color_option. 528131554Stjr Removed 'always|never|auto' arguments, not necessary for grep. 529131554Stjr (exclude_pattern): new variable, holder for the file pattern. 530131554Stjr (include_pattern): new variable, hoder for the file pattern. 531131554Stjr * src/savedir.c: Signature change, take two new argmuments. 532131554Stjr * doc/grep.texi: Document, new options. 533131554Stjr * doc/grep.man: Document, new options. 534131554Stjr 535131554Stjr2001-02-09 Alain Magloire 536131554Stjr 537131554Stjr * src/grep.c (long_options): Added equivalent to -r with -R. 538131554Stjr * src/grep.c (usage): added --color and --colour. 539131554Stjr Noted with patch from, H.Merijn Brand and Wichert Akkerman. 540131554Stjr 541131554Stjr2001-02-09 Alain Magloire 542131554Stjr 543131554Stjr Patch from Ulrich Drepper to provide hilighting. 544131554Stjr 545131554Stjr * src/grep.c: New option --color. 546131554Stjr (color): New static var. 547131554Stjr (COLOR_OPTION): new constant. 548131554Stjr (grep_color): new static var. 549131554Stjr (prline): Now when color is set prline() will call the current matcher 550131554Stjr to find the offset of the matching string. 551131554Stjr * src/savedir.c: Take advantage of _DIRENT_HAVE_TYPE if supported. 552131554Stjr * src/search.c (EGexecute, Fexecute, Pexecute): Take a new argument 553131554Stjr when doing exact match for the color hiligting. 554131554Stjr 555131554Stjr2000-09-01 Brian Youmans 556131554Stjr 557131554Stjr * doc/grep.texi: Typo fixes. 558131554Stjr 559131554Stjr2000-08-30 Paul Eggert 560131554Stjr 561131554Stjr * doc/grep.texi (Usage): Talk about what "grep -r hello *.c" 562131554Stjr means. 563131554Stjr 564131554Stjr2000-08-20 Paul Eggert 565131554Stjr 566131554Stjr Handle range expressions correctly even when they match 567131554Stjr strings with two or more characters. 568131554Stjr 569131554Stjr * src/dfa.h (CRANGE): New enum value. Comment fix. 570131554Stjr 571131554Stjr * src/dfa.c: Include <locale.h> if HAVE_SETLOCALE. 572131554Stjr Include "hard-locale.h". 573131554Stjr (prtok): Print CRANGE. 574131554Stjr (hard_LC_COLLATE): New static var. 575131554Stjr (lex): Return CRANGE when parsing a character range in a hard locale. 576131554Stjr Don't use strcoll; it's no longer needed and wasn't correct anyway. 577131554Stjr Use unsigned rather than token to hold unsigned chars. 578131554Stjr (addtok): Comment fix. 579131554Stjr (atom): Treat a CRANGE as if it were (.\1), approximately. 580131554Stjr (dfaparse): Initialize hard_LC_COLLATE. 581131554Stjr 582131554Stjr * src/Makefile.am (base_sources): Add hard-locale.c, hard-locale.h. 583131554Stjr 584131554Stjr * src/hard-locale.c, src/hard-locale.h: New files, taken from 585131554Stjr textutils. 586131554Stjr 587131554Stjr2000-08-20 Paul Eggert 588131554Stjr 589131554Stjr * tests/Makefile.am (TESTS_ENVIRONMENT): Add LC_ALL=C, since 590131554Stjr some of the tests assume the C locale. 591131554Stjr 592131554Stjr2000-08-16 Paul Eggert 593131554Stjr 594131554Stjr * src/search.c (Gcompile, Ecompile): -x overrides -w, for 595131554Stjr consistency with fgrep. Don't assume that sizes fit in 'int'. 596131554Stjr Fix comments to match code. 597131554Stjr 598131554Stjr2000-06-06 Paul Eggert 599131554Stjr 600131554Stjr * src/grep.c (grepdir): Don't look at st_dev when testing for 601131554Stjr Mingw32 bug. 602131554Stjr 603131554Stjr2000-06-05 Paul Eggert 604131554Stjr 605131554Stjr Port to Mingw32, based on suggestions from Christian Groessler 606131554Stjr <cpg@aladdin.de>. 607131554Stjr 608131554Stjr * src/isdir.c: New file, taken from fileutils. 609131554Stjr 610131554Stjr * src/Makefile.am (base_sources): Add isdir.c. 611131554Stjr 612131554Stjr * src/grep.c (grepfile): Use isdir instead of doing it inline. 613131554Stjr (grepdir): Suppress ancestor check if the directory's inode and device 614131554Stjr are both zero, as that occurs only on Mingw32 which doesn't support 615131554Stjr inode or device. 616131554Stjr 617131554Stjr * src/system.h (isdir): New decl. 618131554Stjr (is_EISDIR): Depend on HAVE_DIR_EACCES_BUG, not D_OK. 619131554Stjr Use isdir, not access. 620131554Stjr 621131554Stjr2000-06-02 Paul Eggert 622131554Stjr 623131554Stjr Problen noted by Gerald Stoller <gerald_stoller@hotmail.com> 624131554Stjr 625131554Stjr * src/grep.c (main): POSIX.2 says that -q overrides -l, which 626131554Stjr in turn overrides the other output options. Fix grep to 627131554Stjr behave that way. 628131554Stjr 629131554Stjr2000-05-27 Paul Eggert 630131554Stjr 631131554Stjr Simplify and tune the buffer allocation strategy. Do not reserve a 632131554Stjr large save area: reserve only enough bytes to hold the residue, plus 633131554Stjr page alignment. Put a newline sentinel before the buffer, for speed 634131554Stjr when searching backwards for newline. 635131554Stjr 636131554Stjr * src/grep.c (ubuffer, bufsalloc, PREFERRED_SAVE_FACTOR, page_alloc): 637131554Stjr Remove. All uses changed. 638131554Stjr (INITIAL_BUFSIZE): New macro. 639131554Stjr (reset, fillbuf): Use simpler buffer allocation strategy. 640131554Stjr (reset): Check for preposterously large pagesize that would cause 641131554Stjr later calculations to overflow. 642131554Stjr (fillbuf): Do not resize buffer if there's room at the end for 643131554Stjr at least one more page. This greatly increases performance when 644131554Stjr reading from non-regular files that contain no newlines. 645131554Stjr When growing the buffer, double its size instead of using a 646131554Stjr more complicated algorithm. 647131554Stjr (prtext, grep): Speed up by relying on the newline sentinel before the 648131554Stjr start of the buffer. 649131554Stjr (grep): When looking backwards for the last newline in a buffer, 650131554Stjr stop when we hit the residue, since it can't contain a newline. 651131554Stjr This avoids an O(N**2) algorithm when reading binary data from 652131554Stjr a pipe. Use a sentinel to speed up the backward search for newline. 653131554Stjr (nlscan): Undo previous change; it wasn't needed and just complicates 654131554Stjr and slows down the code a tad. 655131554Stjr 656131554Stjr2000-05-24 Paul Eggert 657131554Stjr 658131554Stjr Handle very large input counts better. Bug noted by Jim Meyering. 659131554Stjr 660131554Stjr * src/grep.c (totalcc, totalnl): Use uintmax_t, not off_t. 661131554Stjr (add_count): New function. 662131554Stjr (nlscan, prline, grep): Use it to check line and byte count overflows. 663131554Stjr (nlscan, grep): Don't keep track of counts when not asked to; this 664131554Stjr avoids unnecessary overflow diagnostics. 665131554Stjr (print_offset_sep): Now takes args of type uintmax_t and char, 666131554Stjr not off_t and int. 667131554Stjr 668131554Stjr2000-05-16 Paul Eggert 669131554Stjr 670131554Stjr Problem reported by Bob Proulx <rwp@hprwp.fc.hp.com>, this patch 671131554Stjr is base on his finding, with appropiate corrections. 672131554Stjr 673131554Stjr * src/grep.c (main): Fix bug: -x and -w matched even when no 674131554Stjr patterns were specified. 675131554Stjr * tests/empty.sh: Test for -x and -w bug in grep 2.4.2. 676131554Stjr 677131554Stjr2000-04-24 Paul Eggert 678131554Stjr 679131554Stjr POSIX.2 conformance fixes: grep -q now exits with status zero 680131554Stjr if an input line is selected, even if an error also occurs. 681131554Stjr grep -s no longer affects exit status. 682131554Stjr 683131554Stjr * src/grep.c (suppress_errors): Move definition earlier so 684131554Stjr that suppressible_error can use it. 685131554Stjr (suppressible_error): New function. 686131554Stjr (exit_on_match): New var. 687131554Stjr (grepbuf): If exit_on_match is nonzero, exit with status zero 688131554Stjr immediately. 689131554Stjr (grep, grepfile, grepdir): Invoke suppressible_error. 690131554Stjr (main): -q sets exit_on_match. 691131554Stjr 692131554Stjr * doc/grep.1, doc/grep.texi, NEWS: 693131554Stjr Document -q's behavior as required by POSIX.2. 694131554Stjr 695131554Stjr * tests/status.sh: 696131554Stjr Test for -q and -s behavior as conforming to POSIX.2. 697131554Stjr 698131554Stjr2000-04-20 Paul Eggert 699131554Stjr 700131554Stjr * tests/Makefile.am (TESTS_ENVIRONMENT): 701131554Stjr Set GREP_OPTIONS to the empty string. 702131554Stjr 703131554Stjr2000-04-20 Paul Eggert 704131554Stjr 705131554Stjr * tests/status.sh: Fix typo: test -b -> test -r. 706131554Stjr 707131554Stjr2000-04-20 Paul Eggert 708131554Stjr 709131554Stjr * src/dfa.c (lex): 710131554Stjr Do not assume that [c] is equivalent to [c-c]; this isn't true 711131554Stjr if LC_COLLATE specifies that some characters are equivalent. 712131554Stjr (setbit_case_fold): New function. 713131554Stjr (lex): Use it to simplify the code a bit. 714131554Stjr 715131554Stjr2000-04-17 Paul Eggert 716131554Stjr 717131554Stjr Do CRLF munging only if HAVE_DOS_FILE_CONTENTS, instead of 718131554Stjr having it depend on O_BINARY (which leads to incorrect results 719131554Stjr on BeOS, VMS, and MacOS). 720131554Stjr 721131554Stjr * bootstrap/Makefile.try (DEFS): Add -DHAVE_DOS_FILE_CONTENTS. 722131554Stjr * src/system.h (SET_BINARY): Define only if HAVE_DOS_FILE_CONTENTS. 723131554Stjr (O_BINARY): Do not define. 724131554Stjr 725131554Stjr * m4/dosfile.m4: Define HAVE_DOS_FILE_CONTENTS if it appears we're 726131554Stjr using DOS. 727131554Stjr 728131554Stjr * src/grep.c (undossify_input, fillbuf, dosbuf.c, prline, main): 729131554Stjr Depend on HAVE_DOS_FILE_CONTENTS, not O_BINARY, when handling CRLF 730131554Stjr matters. 731131554Stjr (grepfile, main): Depend on SET_BINARY, not O_BINARY, when 732131554Stjr handling binary files on hosts that care about text versus binary. 733131554Stjr 734131554Stjr2000-04-17 Paul Eggert 735131554Stjr 736131554Stjr * lib/getpagesize.h (getpagesize): Define to B_PAGE_SIZE if 737131554Stjr __BEOS__ is defined. Based on a fix by Bruno Haible 738131554Stjr <haible@clisp.cons.org>. 739131554Stjr 740131554Stjr2000-04-17 Bruno Haible 741131554Stjr 742131554Stjr * src/system.h [BeOS]: Ignore O_BINARY. 743131554Stjr * src/getpagesize.h [BeOS]: Define getpagesize() as B_PAGE_SIZE. 744131554Stjr 745131554Stjr2000-04-10 Paul Eggert 746131554Stjr 747131554Stjr * doc/grep.1, doc/grep.texi, NEWS: -C now requires an operand. 748131554Stjr * src/grep.c (short_options, long_options, main, usage): Likewise. 749131554Stjr (context_length_arg): Renamed from ck_atoi. Now reports an error 750131554Stjr and exits if the number is out of range for a context length. 751131554Stjr (get_nondigit_option): New function, which checks for overflow 752131554Stjr correctly, and which does not parse nonadjacent strings of digits 753131554Stjr into a single number. 754131554Stjr (main): Use get_nondigit_option instead of doing the code inline. 755131554Stjr With -A, -B, and -C, optarg is now guaranteed to be nonzero. 756131554Stjr 757131554Stjr2000-04-08 Paul Eggert 758131554Stjr 759131554Stjr Now that we know that the input is always terminated by a 760131554Stjr newline before the matching algorithms see it, clean up the 761131554Stjr matching algorithms so that they no longer need to modify the 762131554Stjr input by inserting a sentinel newline, and no longer worry 763131554Stjr about running off the end of the buffer due to a missing sentinel. 764131554Stjr 765131554Stjr * src/grep.c (nlscan, prpending, prtext, grepbuf): Do not 766131554Stjr worry about running off the end of the input buffer, since 767131554Stjr it's now guaranteed to end in the sentinel newline. 768131554Stjr * src/search.c (EGexecute, Pexecute): Likewise. 769131554Stjr 770131554Stjr * src/dfa.c (prtok, dfasyntax, dfaparse, copy, merge, state_index, 771131554Stjr epsclosure, dfaexec, dfacomp): 772131554Stjr Change many instances of "T *" to "T const *", to catch 773131554Stjr any inadvertent programming errors made during this conversion. 774131554Stjr * src/dfa.h (dfacomp, dfaexec, dfaparse): Likewise. 775131554Stjr * src/grep.c (struct stats.parent, long_options, grepdir, 776131554Stjr compile, execute, fillbuf, lastnl, lastout, nlscan, prline, 777131554Stjr prpending, prtext, grepbuf, grep, grepfile, grepdir): Likewise. 778131554Stjr * src/grep.h (struct matcher.compile, struct matcher.execute): 779131554Stjr Likewise. 780131554Stjr * src/kwset.c (struct kwset.trans, kwsalloc, kwsincr, treefails, 781131554Stjr treedelta, hasevery, treenext, bmexec, cwexec, kwsexec): Likewise. 782131554Stjr * src/kwset.h (kwsalloc, kwsincr, kwsexec): Likewise. 783131554Stjr * src/search.c (kwsmusts, Gcompile, Ecompile, EGexecute, Pcompile, 784131554Stjr Pexecute): Likewise. 785131554Stjr 786131554Stjr * src/dfa.c (dfaexec): 787131554Stjr Use size_t, not char *, to avoid worrisome casts to convert 788131554Stjr char const * to char *. 789131554Stjr * src/dfa.h (dfaexec): Likewise. 790131554Stjr * src/grep.c (execute): Likewise. 791131554Stjr * src/grep.h (execute): Likewise. 792131554Stjr * src/kwset.c (bmexec, cwexec, kwsexec): Likewise. 793131554Stjr * src/kwset.h (struct kwsmatch.offset, kwsalloc, kwsincr, 794131554Stjr kwsexec): Likewise. 795131554Stjr * src/search.c (EGexecute, Fexecute, Pexecute): Likewise. 796131554Stjr 797131554Stjr * src/dfa.h (_PTR_T): Depend on defined __STDC__, not __STDC__. 798131554Stjr (PARAMS): Depend on PROTOTYPES, not __STDC__. 799131554Stjr 800131554Stjr * src/dfa.c (dfasyntax): Last arg is unsigned char, not int. 801131554Stjr * src/dfa.h (dfasyntax): Likewise. 802131554Stjr 803131554Stjr * src/dfa.h (struct dfa): Remove member newlines; no longer needed. 804131554Stjr * src/dfa.c (build_state, dfaexec, dfafree): Do not worry 805131554Stjr about special newline state. 806131554Stjr 807131554Stjr * src/search.c (matchers): Move definition to end of file, so 808131554Stjr that we don't need forward decls. 809131554Stjr (lastexact): Remove. 810131554Stjr (kwset_exact_matches): New var; subsumes old lastexact var. 811131554Stjr All uses changed. 812131554Stjr 813131554Stjr * src/dfa.c (index): Remove macro. 814131554Stjr (REALLOC_IF_NECESSARY): Skip unnecessary test. 815131554Stjr (tstbit, setbit, clrbit): Declare arg to be unsigned, to help compiler. 816131554Stjr (copyset, zeroset, equal): Use C builtin primitives, to help compiler. 817131554Stjr (dfaexec): Do not modify input string. 818131554Stjr Remove newline parameter; no longer needed. 819131554Stjr (comsubs): Use strchr, not index. 820131554Stjr 821131554Stjr * src/grep.h (matchers): Use fixed name size, not pointer (as 822131554Stjr there's no need for the extra flexibility). All uses changed. 823131554Stjr 824131554Stjr * src/kwset.h (struct kwsmatch.offset): Renamed from beg, with 825131554Stjr change of type to size_t. All uses changed. 826131554Stjr 827131554Stjr * src/grep.c (reset): No longer need kludge for dfaexec. Simplify. 828131554Stjr (reset, grepbuf): Adjust to new interface for 'execute'. 829131554Stjr (install_matcher): List is now terminated by null compile, 830131554Stjr not null name. 831131554Stjr Do not invoke setrlimit if that wouldn't change the limit. 832131554Stjr 833131554Stjr * src/dfa.c (xcalloc, xmalloc, xrealloc, prtok, tstbit, setbit, 834131554Stjr clrbit, copyset, zeroset, notset, equal, charclass_index, 835131554Stjr looking_at, lex, addtok, atom, nsubtoks, copytoks, closure, 836131554Stjr branch, regexp, copy, insert, merge, delete, state_index, 837131554Stjr build_state, build_state_zero, icatalloc, icpyalloc, istrstr, 838131554Stjr ifree, freelist, enlist, comsubs, addlists, inboth): 839131554Stjr Remove forward decls; no longer needed. 840131554Stjr * src/grep.c (ck_atoi, usage, error, setmatcher, 841131554Stjr install_matcher, prepend_args, prepend_default_options, 842131554Stjr page_alloc, reset, fillbuf, grepbuf, prtext, prpending, prline, 843131554Stjr print_offset_sep, nlscan, grep, grepfile): Likewise. 844131554Stjr * src/kwset.c (enqueue, treefails, treedelta, hasevery, 845131554Stjr treenext, bmexec, cwexec): Likewise. 846131554Stjr * src/search.c (Gcompile, Ecompile, EGexecute, Fcompile, Fexecute, 847131554Stjr Pcompile, Pexecute, kwsinit): Likewise. 848131554Stjr 849131554Stjr * src/search.c (Pcompile): Do not assume newly allocated 850131554Stjr storage is zeroed. 851131554Stjr 852131554Stjr2000-04-06 Paul Eggert 853131554Stjr 854131554Stjr * doc/grep.1, doc/grep.texi, NEWS: Improve the explanation of 855131554Stjr locale-dependent behavior of range expressions. Mention 856131554Stjr LC_COLLATE, since this affects range expressions. 857131554Stjr 858131554Stjr2000-03-26 Paul Eggert 859131554Stjr 860131554Stjr * Makefile.am (ACINCLUDE_INPUTS): Add decl.m4, inttypes_h.m4, 861131554Stjr uintmax_t.m4, ulonglong.m4, xstrtoumax.m4. 862131554Stjr * m4/Makefile.am (EXTRA_DIST): Likewise. 863131554Stjr 864131554Stjr * src/Makefile.am (base_sources): 865131554Stjr Add xstrtol.c, xstrtol.h, xstrtoumax.c. 866131554Stjr (EXTRA_DIST): Add strtol.c. 867131554Stjr 868131554Stjr * configure.in (jm_AC_TYPE_UINTMAX_T, jm_AC_PREREQ_XSTRTOUMAX, 869131554Stjr HAVE_DECL_STRTOUL, HAVE_DECL_STRTOULL): Add. 870131554Stjr (AC_REPLACE_FUNCS): Add strtoul. 871131554Stjr 872131554Stjr * src/grep.c: Include xstrtol.h. 873131554Stjr (ck_atio): Use xstrtoumax and do proper overflow checking. 874131554Stjr (max_count, outleft): Now off_t, not int. 875131554Stjr (main): Likewise. Use xstrtoumax to convert max_count from string. 876131554Stjr 877131554Stjr * acconfig.h (HAVE_DECL_STRTOUL, HAVE_DECL_STRTOULL): New #undefs. 878131554Stjr (HAVE_STPCPY, ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, 879131554Stjr HAVE_LC_MESSAGES): Remove. 880131554Stjr 881131554Stjr * m4/decl.m4, m4/inttypes_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4, 882131554Stjr m4/xstrtoumax.m4, src/strtol.c, src/strtoul.c, src/strtoull.c, 883131554Stjr src/strtoumax.c, src/xstrtol.c, src/xstrtol.h, src/xstrtoumax.c: 884131554Stjr New files, taken unchanged from textutils, fileutils, sh-utils 885131554Stjr and/or tar. 886131554Stjr 887131554Stjr2000-03-23 Paul Eggert 888131554Stjr 889131554Stjr * src/search.c (Pcompile): Add support for NUL bytes in 890131554Stjr Perl regular expressions. 891131554Stjr 892131554Stjr2000-03-23 Paul Eggert 893131554Stjr 894131554Stjr * NEWS, doc/grep.1, doc/grep.texi: Change --pcre to --perl-regexp. 895131554Stjr * src/grep.c (long_options, usage): Likewise. 896131554Stjr 897131554Stjr * doc/grep.1, doc/grep.texi: Remove pgrep program. 898131554Stjr * src/Makefile.am (bin_PROGRAMS): Likewise. 899131554Stjr (pgrep_SOURCES): Remove. 900131554Stjr 901131554Stjr * src/grep.c (main): Rename matcher from "pgrep" to "perl". 902131554Stjr * src/search.c (matchers): Likewise. 903131554Stjr 904131554Stjr * src/search.c: Do not include stdio.h; no longer needed. 905131554Stjr (NILP): Remove. 906131554Stjr (sub): No longer static. 907131554Stjr (n_pcre): Remove. 908131554Stjr (cre): No longer an array. Present only if HAVE_LIBPCRE. 909131554Stjr (extra): New variable. 910131554Stjr (Pcompile): Use fatal to report errors. 911131554Stjr This also removes a possible core dump. 912131554Stjr Add checks (marked FIXME) for restrictions in pcre. 913131554Stjr Use pcre_maketables for proper localized behavior. 914131554Stjr (Pcompile, Pexecute): Use GNU coding style. 915131554Stjr The argument is a single pattern, not a list of patterns separated 916131554Stjr by newlines; this is for consistency with grep and egrep. 917131554Stjr Use pcre_study for speed. 918131554Stjr (Pexecute): Abort if we lack pcre. 919131554Stjr Abort if pcre_exec reports an impossible error. 920131554Stjr Use code similar to the rest of search.c 921131554Stjr to narrow down to the line we've found. 922131554Stjr 923131554Stjr2000-03-21 Alain Magloire 924131554Stjr 925131554Stjr * configure.in: added AC_CHECK_LIB(pcre, pcre_exec) 926131554Stjr * ChangeLog: Typos corrected. 927131554Stjr * src/search.c: new MACRO HAVE_LIBPCRE 928131554Stjr 929131554Stjr2000-03-21 H.Merijn Brand 930131554Stjr 931131554Stjr * src/Makefile.am(bin_PROGRAMS): added pgrep and new macro 932131554Stjr pgrep_SOURCES. 933131554Stjr * src/search.c: new functions Pcompile() and Pexecute() 934131554Stjr to support PCRE. Update matcher[] array for pgrep. 935131554Stjr * src/grep.c: new short and long option --pcre and -P. 936131554Stjr usage() updated. 937131554Stjr 938131554Stjr2000-03-21 Bastiaan Stougie 939131554Stjr 940131554Stjr Improvement of the -m or --max-count option. Now works for NUM > 1 and 941131554Stjr prints trailing context for the last matching line. 942131554Stjr 943131554Stjr * src/grep.c 944131554Stjr (after_last_match): Is a new off_t variable that replaces inputhwm 945131554Stjr to retain the correct input offset even after a call to fillbuf. Note 946131554Stjr that after_last_match has a different meaning than inputhwm: 947131554Stjr it always points to the offset in the input of the first byte after 948131554Stjr the last matching line, and is 0 if no matching line has been found 949131554Stjr yet. 950131554Stjr (grep): Print trailing context after the NUMth match when the -m NUM 951131554Stjr option is used. 952131554Stjr (grep): Added comment. Should have been commented already. 953131554Stjr (grepbuf): Now updates outleft correctly. This fixes the bug that the 954131554Stjr -m NUM option did not stop after NUM lines for NUM greater than 1. 955131554Stjr (grepbuf, prtext): Now update after_last_match instead of inputhwm. 956131554Stjr (fillbuf): No longer updates inputhwm. 957131554Stjr (prpending): When outputting trailing context of the max_count-th 958131554Stjr matching line, stop at the first matching line. 959131554Stjr (grepfile): Seek to after_last_match or eof, depending on the values 960131554Stjr of outleft and bufmapped. 961131554Stjr (usage): added the -m or --max-count option to the help message. 962131554Stjr * doc/grep.texi, doc/grep.1: Document the change of the -m option. 963131554Stjr 964131554Stjr2000-03-17 Paul Eggert 965131554Stjr 966131554Stjr Add new -m or --max-count option, based on a suggestion by 967131554Stjr Bastiaan Stougie. 968131554Stjr 969131554Stjr * doc/grep.texi, doc/grep.1: Document it. 970131554Stjr * src/grep.c (short_options, long_options, main): Add it. 971131554Stjr (inputhwm): New variable. 972131554Stjr (fillbuf, prtext, grepbuf): Set it. 973131554Stjr (bufmapped): Now a macro (defined to zero) if HAVE_MMAP is not defined. 974131554Stjr (max_count, outleft): New variables. 975131554Stjr (prtext, grepbuf, grep): Don't output more than outleft lines. 976131554Stjr (grepfile): If grepping standard input, seek to the limit of what 977131554Stjr we've read before exiting. This fixes a bug with mmapped input, 978131554Stjr and is needed for proper -m support. 979131554Stjr (main): Exit immediately if -m 0 is specified. 980131554Stjr 981126432Sache2000-03-08 Alain Magloire 982126432Sache 983126432Sache * configure.in: version 2.4.2 984126432Sache 985126432Sache2000-03-07 Paul Eggert 986126432Sache 987126432Sache * Make intl subdirectory match fileutils, tar, etc.; 988126432Sache see intl/ChangeLog for details. 989126432Sache 990126432Sache * src/getpagesize.h: Reformat to match latest fileutils. 991126432Sache 992126432Sache * src/savedir.c (savedir): Work even if directory size is 993126432Sache negative; this can happen with some NFS screwups. 994126432Sache 995126432Sache2000-03-03 Jim Meyering 996126432Sache 997126432Sache * regex.m4: Make sure re_compile_pattern accepts patterns like `{1'. 998126432Sache 999126432Sache2000-03-02 Alain Magloire 1000126432Sache 1001126432Sache * 2.4.1 Release 1002126432Sache 1003126432Sache2000-02-25 Paul Eggert 1004126432Sache 1005126432Sache * configure.in (LIBOBJS): Work around automake 1.4 bug: 1006126432Sache regex.c wasn't being passed through ansi2knr on pre-ANSI hosts. 1007126432Sache (ac_use_included_regex): Fix typo in warning. 1008126432Sache * src/Makefile.am (EXTRA_DIST): Remove regex.c, as the LIBOBJS 1009126432Sache workaround means that automake now puts regex.c into DIST_COMMON. 1010126432Sache 1011126432Sache2000-02-25 Alain Magloire 1012126432Sache 1013126432Sache * po/*.po: update of the PO files. 1014126432Sache 1015126432Sache2000-02-22 Eli Zaretskii 1016126432Sache 1017126432Sache * doc/grep.1: Two small glitches(typos). 1018126432Sache 1019126432Sache2000-02-18 Eli Zaretskii 1020126432Sache 1021126432Sache * djgpp/config.site (prefix, INSTALL): Use /dev/env/DJDIR instead 1022126432Sache of ${DJDIR}, so that the produced Makefile's work on any DJGPP 1023126432Sache installation. 1024126432Sache 1025126432Sache2000-01-30 Alain Magloire 1026126432Sache 1027126432Sache * doc/grep.1: corrected typo. 1028131554Stjr Noted by Ruslan Ermilov. 1029126432Sache 1030126432Sache2000-01-30 Alain Magloire 1031126432Sache 1032126432Sache * vms/Makefile.am: added config_vms.h to EXTRA_DIST. 1033126432Sache * vms/config_vms.h: New File, contains macros specific to VMS and 1034126432Sache avoid namespace collision with operating system supplied C library. 1035126432Sache * vms/make.com: Better compiler auto-detection; information for builds 1036126432Sache on pre-OpenVMS 7.x systems; general overhaul. 1037126432Sache * src/getpagesize.h: Reinstate support for different pagesizes on 1038126432Sache VAX and Alpha. Work around problem with DEC C compiler. 1039126432Sache * src/vms_fab.c: Cast to some assigments; fixed typo argcp vs. argp. 1040126432Sache * src/vms_fab.h: Added new include files to avoid warnings about 1041126432Sache undefined function prototypes. 1042126432Sache Those patches were provided by Martin P.J. Zinser (zinser@decus.de). 1043126432Sache 1044126432Sache2000-01-30 Paul Eggert 1045126432Sache 1046126432Sache * src/grep.c (main): Update copyright notice. 1047126432Sache 104856915Sru2000-01-28 Alain Magloire 104956915Sru 105056915Sru * src/grep.c (usage): The example "%s -i 'hello.*world' could 105156915Sru lead to confusion when progname is 'fgrep. 105256915Sru Noted by Akim Demaille. 105356915Sru 105456915Sru * configure.in: Reenable, jm_INCLUDE_REGEX() since we now 105556915Sru track GNU lib C. 1056126432Sache * src/Makefile.am: EXTRA_DIST new macros with regex.c regex.h. 105756915Sru Requested By Ulrich Drepper. 1058126432Sache 105956915Sru2000-01-25 Paul Eggert 106056915Sru 106156915Sru * src/grep.c (grep): If the final byte of an input file is not 106256915Sru a newline, grep now silently supplies one. 1063126432Sache * doc/grep.texi, NEWS: Likewise. 106456915Sru 106556915Sru2000-01-25 Paul Eggert 106656915Sru 106756915Sru * NEWS, doc/grep.1, doc/grep.texi: Add -I option. 106856915Sru * src/grep.c (short_options, usage, main): Likewise. 106956915Sru 107056915Sru * doc/grep.texi: Fix some incorrect references to ASCII. 107156915Sru 107256915Sru2000-01-25 Paul Eggert 107356915Sru 107456915Sru * doc/grep.1: Simplify synopsis; sort options; mention 107556915Sru environment variables; clean up some minor gaffes. 107656915Sru 107756915Sru2000-01-25 Paul Eggert 107856915Sru 107956915Sru * doc/grep.texi: 108056915Sru Fix some errors in description of [:print:] and the like. 108156915Sru 108256915Sru2000-01-23 Paul Eggert 108356915Sru 108456915Sru * src/dfa.c (FETCH, lex): Put brackets around if-body to avoid 108556915Sru GCC warning about ambiguous if-then-else. 108656915Sru 108756915Sru2000-01-23 Paul Eggert 108856915Sru 108956915Sru * src/regex.c (GET_UNSIGNED_NUMBER): Allow only ASCII digits. 109056915Sru * src/dfa.c (ISASCIIDIGIT): New macro. 109156915Sru (lex): Use it instead of ISDIGIT. 109256915Sru 109356915Sru2000-01-23 Paul Eggert 109456915Sru 109556915Sru The bug is that regular expression ranges like [a-z] compare raw 109656915Sru byte codes to the range boundaries, whereas POSIX says that they 109756915Sru should use the current collating sequence instead. For example, 109856915Sru in Solaris 7 with LC_ALL=en_US, the command 109956915Sru echo x | grep '[ -~]' 110056915Sru outputs 'x', but it shouldn't output anything since ' ' and '~' 110156915Sru sort before all letters in that locale. 110256915Sru 110356915Sru * src/regex.c (compile_range): When matching a character 110456915Sru range, use the current collating sequence, as POSIX requires. 110556915Sru * src/dfa.c (lex): Likewise. 110656915Sru 110756915Sru2000-01-20 Alain Magloire 110856915Sru 110956915Sru * tests/Makefile.am (dist-hook): Added new rule to make sure 111056915Sru that the shell scripts have the right permissions. 111156915Sru * src/posix/Makefile.am (EXTRA_DIST): added regex.h in the 111256915Sru distribution. 111356915Sru * THANKS: updated. 111456915Sru 111556915Sru2000-01-18 Alain Magloire 111656915Sru 111756915Sru * Rectification the initial patch to add --binary-file option 111856915Sru was done by Ruslan Ermilov. 111956915Sru 112056915Sru2000-01-17 Paul Eggert 112156915Sru 112256915Sru Sync with sources of fileutils 4.0n, tar 1.13.17, glibc 2.1.3a1. 112356915Sru Convert to ANSI C prototypes (using ansi2knr for backwards 112456915Sru compatibility), as this makes it easier to sync. 112556915Sru 112656915Sru * configure.in (AC_OBJEXT): Spell in a funny way, to work around 112756915Sru a bug in automake 1.4 with ansi2knr. 112856915Sru (LIBOBJS): Add assignment so that .o files in LIBOBJS are also built 112956915Sru via the ANSI2KNR-filtering rules. 113056915Sru (AC_OUTPUT): Add src/posix/Makefile. 113156915Sru * src/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr. 113256915Sru (SUBDIRS): New macro. 113356915Sru * src/ansi2knr.1, src/ansi2knr.c, src/posix/Makefile.am: New files. 113456915Sru * src/dfa.c, src/dosbuf.c, src/grep.c, src/kwset.c, src/search.c, 113556915Sru src/vms_fab.c: 113656915Sru Use prototypes for function definitions. 113756915Sru * src/grep.c (main): Use int counter for default context, 113856915Sru fixing an ANSI portability bug uncovered by the above changes. 113956915Sru 114056915Sru * config.guess, config.sub, install-sh, missing, src/alloca.c, 114156915Sru src/getpagesize.h, src/memchr.c, src/savedir.c, src/savedir.h, 114256915Sru src/stpcpy.c: 114356915Sru Upgrade to latest version from fileutils 4.0n. 114456915Sru 114556915Sru * src/getopt.c, src/getopt.h, src/getopt1.c: Upgrade to latest 114656915Sru version from tar 1.13.17. 114756915Sru 114856915Sru * src/obstack.c, src/obstack.h, src/regex.c, src/regex.h: 114956915Sru Upgrade to glibc 2.1.3 alpha 1, with K&R C portability fix. 115056915Sru * src/posix/regex.h: New file, from glibc 2.1.3 alpha 1. 115156915Sru 115256230Sru2000-01-04 Paul Eggert 115356230Sru 1154131554Stjr Initial patch by Ruslan Ermilov. 115556230Sru 115656230Sru Add --binary-files option. 115756230Sru * NEWS, doc/grep.1, doc/grep.texi: Document it. 115856230Sru * src/grep.c (BINARY_FILES_OPTION): New constant. 115956230Sru (long_options, grep, usage, main): New --binary-files option. 116056230Sru (binary_files): New var. 116156230Sru * src/system.h (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, CHAR_MAX): 116256230Sru New macros. 116356230Sru (INT_MAX, UCHAR_MAX): Define in terms of TYPE_MAXIMUM. 116456230Sru 116556230Sru2000-01-04 Paul Eggert 116656230Sru 116756230Sru * savedir.c (savedir): Don't store past the end of an array if 116856230Sru name_size is zero and the directory is empty. 116956230Sru Reported by Dima Barsky <dima@pwd.hp.com>. 117056230Sru 1171126432Sache1999-12-03 Alain Magloire 1172126432Sache 1173126432Sache * 2.4 Release. 1174126432Sache 117555360Sobrien1999-11-18 Paul Eggert 117655360Sobrien 117755360Sobrien * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a 117855360Sobrien problem with the QNX 4.25 shell, which doesn't propagate exit 117955360Sobrien status of failed commands inside shell assignments. 118055360Sobrien 118155360Sobrien1999-11-13 Eli Zaretskii 118255360Sobrien 118355360Sobrien * doc/grep.texi: Minor markup and spelling corrections. Use 118455360Sobrien @noindent where appropriate. 118555360Sobrien 118655360Sobrien * PATCHES-{AM,AC}: rename to PATCHES.{AM,AC} 118755360Sobrien 118855360Sobrien1999-11-12 Eli Zaretskii 118955360Sobrien 119055360Sobrien doc/grep.texi: Minor fixes and typos corrected. 119155360Sobrien djgpp/README: Updated version. 119255360Sobrien 119355360Sobrien1999-11-07 Paul Eggert 119455360Sobrien 119555360Sobrien * src/grep.c (usage): Fix misspelling. 119655360Sobrien 119755360Sobrien1999-11-07 Paul Eggert 119855360Sobrien 119955360Sobrien Don't assume that the C library has re_set_syntax and friends. 120055360Sobrien * src/Makefile.am (base_sources): Add regex.c, regex.h. 120155360Sobrien (EXTRA_DIST): Remove regex.c, regex.h. 120255360Sobrien 120355360Sobrien * src/grep.c (prtext): Use out_quiet, not not_text, to decide 120455360Sobrien whether to set pending to zero at the end. 120555360Sobrien (not_text): Remove static variable, undoing latest change. 120655360Sobrien (grep): Likewise. 120755360Sobrien 120855360Sobrien * doc/grep.texi: Tighten up the text, and fix some minor 120955360Sobrien spelling and usage errors. Use @enumerate rather than @table 121055360Sobrien @samp, since it's better for Q&A format. Add cross 121155360Sobrien references. 121255360Sobrien 121355360Sobrien1999-11-01 Alain Magloire 121455360Sobrien 121555360Sobrien * src/search.c: Use the more portable [[:alnum:]] 121655360Sobrien to define a word instead of Ascii dependent [0-9A-Za-z] 121755360Sobrien * src/grep.c: make not_text global to not display text when 121855360Sobrien the context switches -A/-B/-C are use on binary files. 121955360Sobrien * make grep-2.3g available for testing. 122055360Sobrien * configure.in: drop support for --without-included-regex. 122155360Sobrien This was generating bogus bug reports, since many GNU/Linux 122255360Sobrien users have different version of glibc. And glibc maintainers 122356230Sru decided to drop k&r support. 122456230Sru 122555360Sobrien1999-11-01 Arnold D. Robbins 122655360Sobrien 122755360Sobrien * regex.c (init_syntax_once): move below definition of 122855360Sobrien ISALNUM etc., then use ISALNUM to init the table, so that 122955360Sobrien the word ops will work if i18n'ed. 123055360Sobrien (SYNTAX): And subscript with 0xFF for Latin-1 characters. 123155360Sobrien 123255360Sobrien1999-10-26 Alain Magloire 123355360Sobrien 123455360Sobrien * src/regex.c: Merge changes from GNU lib C. 123555360Sobrien * Updated the *.po files 123655360Sobrien 123755360Sobrien1999-10-26 Paul Eggert 123855360Sobrien 123955360Sobrien * src/grep.c (fillbuf): Don't report buffer size overflow if 124055360Sobrien newalloc == save and maxalloc == save. This can happen 124155360Sobrien e.g. when reading a large page-aligned file that contains 124255360Sobrien no newlines. 124355360Sobrien 124455360Sobrien1999-10-21 Paul Eggert 124555360Sobrien 124655360Sobrien * src/grep.c (usage): Give example. Clarify -F. 124755360Sobrien Explain exit status more clearly. 124855360Sobrien 124955360Sobrien1999-10-12 Paul Eggert 125055360Sobrien 125155360Sobrien * doc/grep.texi: Shorten the commentary about egrep and {. 125255360Sobrien "BSD grep" -> "traditional grep". 125355360Sobrien * doc/grep.1: Match recent changes to grep.texi. 125455360Sobrien 125555360Sobrien1999-10-11 Paul Eggert 125655360Sobrien 125755360Sobrien * NEWS, doc/grep.1, doc/grep.texi: New option --mmap. 125855360Sobrien * src/grep.c (mmap_option): New variable. 125955360Sobrien (long_options, reset, usage): Add --mmap. 126055360Sobrien Default is now read, not mmap. 126155360Sobrien 126255360Sobrien * doc/grep.1: Document -Z or --null. 126355360Sobrien 126455360Sobrien1999-10-11 Paul Eggert 126555360Sobrien 126655360Sobrien * doc/grep.texi: Fix texinfo glitches. POSIX -> POSIX.2 where 126755360Sobrien appropriate. 126855360Sobrien 126955360Sobrien1999-10-11 Paul Eggert 127055360Sobrien 127155360Sobrien * acconfig.h (ssize_t): New #undef. 127255360Sobrien 127355360Sobrien * configure.in (AC_CHECK_TYPE): Add ssize_t. 127455360Sobrien 127555360Sobrien * src/grep.c (PREFERRED_SAVE_FACTOR): New macro. 127655360Sobrien (reset): If the buffer has already been allocated, set bufsalloc to 127755360Sobrien be bufalloc / PREFERRED_SAVE_FACTOR. This avoids problems when 127855360Sobrien bufsalloc == bufalloc (possible after reading a large binary file). 127955360Sobrien (reset): Use PREFERRED_SAVE_FACTOR instead of magic constant. 128055360Sobrien Do not set bufbeg; nobody uses it. 128155360Sobrien Always set buflim. 128255360Sobrien Check for lseek error. 128355360Sobrien Use SEEK_CUR, not a magic constant. 128455360Sobrien (fillbuf): Return an error indication, not a count. 128555360Sobrien All callers changed. 128655360Sobrien Do not assume ssize_t fits in int. 128755360Sobrien Use PREFERRED_SAVE_FACTOR instead of magic constant. 128855360Sobrien Clean up mmap code. 128955360Sobrien Do not attempt to mmap zero bytes. 129055360Sobrien Check for lseek error. 129155360Sobrien Use SEEK_SET, not a magic constant. 129255360Sobrien Work correctly if read is interrupted. 129355360Sobrien (grepfile): Work correctly if open or close is interrupted. 129455360Sobrien 129555360Sobrien * src/system.h (SEEK_SET, SEEK_CUR): New macros. 129655360Sobrien 129755360Sobrien1999-10-02 Alain Magloire 129855360Sobrien 129955360Sobrien * src/regex.[ch]: upgrade from GNU lib C source tree. 130055360Sobrien 130155360Sobrien * make beta 2.3f available. 130255360Sobrien 130355360Sobrien1999-10-02 Paul Eggert 130455360Sobrien 130555360Sobrien * NEWS: egrep is now equivalent to `grep -E'. 130655360Sobrien The lower bound of an interval is not optional. 130755360Sobrien You can specify a matcher multiple types without error. 130855360Sobrien -u and -U are now allowed on non-DOS hosts, and have no effect. 130955360Sobrien * doc/grep.texi: Likewise. 131055360Sobrien * doc/grep.1: Likewise. 131155360Sobrien Fix some troff bugs that prevented `groff' from rendering the page. 131255360Sobrien 131355360Sobrien * src/egrepmat.c, src/fgrepmat.c, src/grepmat.c (default_matcher): 131455360Sobrien Remove. 131555360Sobrien (matcher): Add. 131655360Sobrien * src/grep.h (default_matcher): Remove. 131755360Sobrien (matcher): Now exported from ?grepmat.c, not grep.c. 131855360Sobrien 131955360Sobrien * src/dfa.c (lex): If { would start an invalid interval specification, 132055360Sobrien treat it as a normal character. 132155360Sobrien Remove (broken) support for {,M} meaning {0,M}. 132255360Sobrien Diagnose bogus intervals like {1,0}. 132355360Sobrien (closure): maxrep is now -1 to indicate no limit, not zero; 132455360Sobrien zero is a valid value for maxrep, meaning an upper bound of zero. 132555360Sobrien 132655360Sobrien * src/grep.c (short_options): New constant. 132755360Sobrien (long_options, main): -u and -U are now supported on Unix, 132855360Sobrien with no effect. 132955360Sobrien (matcher): Removed; now defined by ?grepmat.c. 133055360Sobrien (install_matcher): Renamed from setmatcher. 133155360Sobrien (setmatcher): New function. 133255360Sobrien (usage): Report new, more uniform option scheme. 133355360Sobrien (main): Do not initialize matcher; ?grepmat.c now does this. 133455360Sobrien Rely on setmatcher to catch matcher conflicts. 133555360Sobrien Default matcher is "grep". 133655360Sobrien 133755360Sobrien * src/search.c (matchers): 133855360Sobrien Remove "posix-egrep" matcher; no longer needed. 133955360Sobrien (Ecompile): Likewise. 134055360Sobrien The egrep matcher now has POSIX behavior. 134155360Sobrien 134255360Sobrien * tests/bre.tests: grep '\{' is no longer an error. 134355360Sobrien Fix test for interval too large, and enable it. 134455360Sobrien * tests/ere.tests: grep -E {1 is no longer an error 134555360Sobrien Likewise for a{1, a{1a, a{1a}, a{1,x}. 134655360Sobrien 134755360Sobrien1999-09-22 Paul Eggert 134855360Sobrien 134955360Sobrien * largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around GCC 135055360Sobrien 2.95.1 bug with HP-UX 10.20. 135155360Sobrien 135255360Sobrien1999-09-12 Paul Eggert 135355360Sobrien 135455360Sobrien * src/grep.c (fillbuf): Fix typo: we sometimes reported 135555360Sobrien arithmetic overflow even when there wasn't any. 135655360Sobrien 135755360Sobrien1999-09-12 Paul Eggert 135855360Sobrien 135955360Sobrien * configure.in (AC_CHECK_FUNCS): Add memmove. 136055360Sobrien 136155360Sobrien * src/system.h (S_ISREG): New macro. 136255360Sobrien (memmove): Define if ! defined HAVE_MEMMOVE && ! defined memmove, 136355360Sobrien not if !defined STDC_HEADERS. This is needed for SunOS 4.1.4, 136455360Sobrien which defines STDC_HEADERS but lacks memmove. 136555360Sobrien 136655360Sobrien * src/grep.c (bufoffset): Needed even if !defined HAVE_MMAP. 136755360Sobrien (reset): Always fstat the file, since we always need its size if it is 136855360Sobrien regular. 136955360Sobrien Similarly, get the buffer offset of every regular file. 137055360Sobrien Set bufmapped to 0 if the file's initial offset is not a multiple 137155360Sobrien of the page size. 137255360Sobrien (fillbuf): Calculate an upper bound on how much memory we should 137355360Sobrien allocate only for regular files, since we don't know the sizes of 137455360Sobrien other files. 137555360Sobrien Don't bother to check whether the file offset is a multiple of the page 137655360Sobrien size, since we now do that just once in `reset'. 137755360Sobrien When an mmapped area would fall past the end of the file, trim it to 137855360Sobrien just before instead of giving up immediately and doing a `read'; 137955360Sobrien that avoids a worst-case behavior that could read half an mmapped file. 138055360Sobrien Fix bug when computing offsets on hosts that don't have mmap. 138155360Sobrien 138255360Sobrien1999-08-27 Paul Eggert 138355360Sobrien 138455360Sobrien * src/system.h (memmove): New macro. 138555360Sobrien 138655360Sobrien * src/grep.c (page_alloc): Reallocate the old buffer instead 138755360Sobrien of having both old and new buffers active simultaneously. 138855360Sobrien Remove valloc debugging variant, which no longer applies. 138955360Sobrien 139055360Sobrien (fillbuf): Rejigger the buffer allocation mechanism. The old 139155360Sobrien mechanism could allocate more than 10*N bytes for an N-byte 139255360Sobrien file, which was excessive. Check for arithmetic overflow a 139355360Sobrien bit more carefully. 139455360Sobrien 139555360Sobrien1999-08-25 Paul Eggert 139655360Sobrien 139755360Sobrien * src/grep.c (grepdir): 139855360Sobrien Don't assume that st_ino and st_dev must be integers; 139955360Sobrien POSIX.1 allows them to be floating-point (!). 140055360Sobrien 140155360Sobrien * src/vms_fab.h (arr_ptr): `:' -> `;' to fix typo. 140255360Sobrien 140355360Sobrien1999-08-18 Alain Magloire 140455360Sobrien 140555360Sobrien * 2.3e snapshot. 140655360Sobrien 140755360Sobrien1999-08-18 Alain Magloire 140855360Sobrien 140955360Sobrien * src/search.c: On a CRAY J90 system running UNICOS 8.0. 141055360Sobrien Compilation of ./src/search.c failed because the declaration of 141155360Sobrien the variable "regex": 141255360Sobrien static struct re_pattern_buffer regex; 141355360Sobrien conflicted with a previous declaration search.c #includes "system.h", 141455360Sobrien which #includes <stdlib.h>, which declares : 141555360Sobrien extern char *regex __((char *_Re, char *_Subject, ...)); 141655360Sobrien The declaration in search.c is local to that one source file. 141755360Sobrien I just changed its name to something less likely to conflict. 141855360Sobrien (I called it "regexbuf", but you could pick any name you want.) 141955360Sobrien Excerpt email from Dean Kopesky. 142055360Sobrien 142155360Sobrien1999-08-16 Paul Eggert 142255360Sobrien 142355360Sobrien Upgrade large-file support to the version used in tar and 142455360Sobrien textutils. 142555360Sobrien 142655360Sobrien * Makefile.am (ACLOCAL_AMFLAGS): Define to be empty. 142755360Sobrien (M4DIR, ACINCLUDE_INPUTS): New macros. 142855360Sobrien ($(srcdir)/acinclude.m4): New rule. 142955360Sobrien 143055360Sobrien * configure.in (AC_CANONICAL_HOST, AM_C_PROTOTYPES): Add. 143155360Sobrien (AC_SYS_LARGEFILE): Renamed from AC_LFS, for compatibility 143255360Sobrien with what should appear in the next autoconf release. 143355360Sobrien 143455360Sobrien * m4/largefile.m4: Renamed from m4/lfs.m4. 143555360Sobrien 143655360Sobrien * src/ansi2knr.1, src/ansi2knr.c, config.guess, config.sub: 143755360Sobrien New files. config.guess and config.sub ar needed by the new 143855360Sobrien AC_SYS_LARGEFILE. ansi2knr is needed by AM_C_PROTOTYPES, 143955360Sobrien which in turn is needed by the new AC_SYS_LARGEFILE. 144055360Sobrien 144155360Sobrien1999-08-16 Alain Magloire 144255360Sobrien 144355360Sobrien * 2.3d snapshot on ftp server. 144455360Sobrien 144555360Sobrien1999-07-26 Paul Eggert 144655360Sobrien 144755360SobrienSeveral GNU tools have options to process arbitrary file names, even 144855360Sobrienfile names that contain newline characters. These include `find 144955360Sobrien-print0', `perl -0', `sort -z', and `xargs -0'. It'd be handy if GNU 145055360Sobriengrep also processed such file names. Here's a proposed patch to do 145155360Sobrienthis, relative to grep 2.3c. This patch introduces two options, one 145255360Sobrienfor the data, and one for the file names. (Sometimes one wants 145355360Sobriennull-terminated file names in the output, and sometimes one wants to 145455360Sobrienprocess lists of null-terminated strings, and these are orthogonal 145555360Sobrienaxes.) 145655360Sobrien 145755360Sobrien * NEWS, doc/grep.texi: New -z or --null-data and -Z or --null options. 145855360Sobrien * src/grep.c (long_options, usage, main): Likewise. 145955360Sobrien 146055360Sobrien * src/dfa.h (dfasyntax): New eol parameter. 146155360Sobrien * src/dfa.c (eolbyte): New var. 146255360Sobrien (dfasyntax): Set it from new parameter. 146355360Sobrien (lex, dfastat, build_state, dfaexec): Use it instead of '\n'. 146455360Sobrien 146555360Sobrien * src/grep.h (eolbyte): New decl. 146655360Sobrien * src/grep.c (eolbyte): New var. 146755360Sobrien (nlscan, prpending, prtext, grepbuf, grep): Use it instead of '\n'. 146855360Sobrien (filename_mask): New var. 146955360Sobrien (prline, grepfile): Output NUL separator if filename_mask is zero. 147055360Sobrien (grep): Look for '\200' as the hallmark of a binary file, not '\0', 147155360Sobrien if -z or --null-data is specified, since it implies that '\0' is 147255360Sobrien expected as text. 147355360Sobrien 147455360Sobrien * src/search.c (Gcompile, Ecompile): Pass eolbyte to dfasyntax. 147555360Sobrien (EGexecute, Fexecute): Use eolbyte instead of '\n'. 147655360Sobrien 147755360Sobrien1999-06-15 Alain Magloire 147855360Sobrien 147956230Sru * src/grep.c, doc/grep{1,texi} : 148055360Sobrien --revert-match should be --invert-match. 148155360Sobrien Correction proposed by Karl Berry. 148255360Sobrien 148355360Sobrien1999-06-12 Alain Magloire 148455360Sobrien 148555360Sobrien * doc/grep.{1,texi}: add description for --with-filename. 148655360Sobrien Noted missing by UEBAYASHI Masao. 148755360Sobrien 148855360Sobrien1999-03-17 Paul Eggert 148955360Sobrien 149055360Sobrien * NEWS: Add GREP_OPTIONS. 149155360Sobrien 149255360Sobrien * doc/grep.texi: Document GREP_OPTIONS, and the other 149355360Sobrien environment variables. Fix doc for [:blank:], [:cntrl:], [:punct:]. 149455360Sobrien 149555360Sobrien * src/grep.c (prepend_args, prepend_default_options): New functions. 149655360Sobrien (main): Use them to implement GREP_OPTIONS. 149755360Sobrien * src/system.h (getenv): New decl. 149855360Sobrien 149955360Sobrien1999-03-16 Volker Borchert 150055360Sobrien 150155360Sobrien * configure.in: Use case case ... esac for checking Visual C++. 150255360Sobrien When ${CC} contains options it was not recognize. 150355360Sobrien 150455360Sobrien1999-03-07 Paul Eggert 150555360Sobrien 150655360Sobrien * src/grep.c (usage): Don't report -E, -F, and -G unless we're grep. 150755360Sobrien (main): Don't match options -E, -F, and -G unless we're grep. 150855360Sobrien Remove after-the-fact check for options -E, -F, and -G, since 150955360Sobrien they're no longer needed. 151055360Sobrien 151155360Sobrien1999-03-05 Eli Zaretskii 151255360Sobrien 151355360Sobrien * src/grep.c (main): Print the name of the default matcher instead 151456230Sru of just "grep". 151555360Sobrien 151655360Sobrien1999-02-06 Alain Magloire 151755360Sobrien 151855360Sobrien * tests/*.awk : Linux users are seeing "Broken Pipe" on make check. 151955360Sobrien The problem is that grep does not drain its stdin, thus the previous 152055360Sobrien process in the pipeline receives a SIGPIPE. Other shells are silent 152155360Sobrien about this. There is actually no failure, since the broken pipe is 152255360Sobrien expected. You can work around it by changing the pipeline, so that 152355360Sobrien the input is drained, like this: 152455360Sobrien status=`echo 'check' | { ${GREP} -E -e pattern >/dev/null 2>&1; 152555360Sobrien echo $?; cat >/dev/null; }`; if test $status -ne $errnu then ... fi 152656230Sru Excerpt email from Andreas Schwab. 152755360Sobrien 152855360Sobrien1999-02-23 Alain Magloire 152955360Sobrien 153055360Sobrien * src/grep.c : Restrict the use of -E, -F, -G 153155360Sobrien to only grep driver, Posix behaviour. {f,e}grep 153255360Sobrien the matcher is already set. This change may brake 153355360Sobrien scripts, warn in NEWS. 153455360Sobrien 153555360Sobrien * doc/grep.{1,texi} : -C takes arguments, upgrade manual. 153655360Sobrien 153755360Sobrien * beta 2.3a 153855360Sobrien 153955360Sobrien1999-02-23 Alain Magloire 154055360Sobrien 154155360Sobrien * configure.in : Change the configure VC test from 154255360Sobrien 'test x$ac_cv_prog_CC = xcl;' to 'test x"$ac_cv_prog_CC" = xcl;' 154355360Sobrien Email from Joshua R. Poulson. 154455360Sobrien 154555360Sobrien1999-02-23 Paul Eggert 154655360Sobrien 154755360Sobrien Fix porting bug reported by Amakawa Shuhei for SunOS 4.1.4-JL. 154855360Sobrien The btowc.c shipped with grep 2.3 is incorrect for Solaris 154955360Sobrien 2.5.1 and earlier, as it assumes UTF8, which these OSes do not 155055360Sobrien support. Solaris 7 supports btowc, so there's no need to ship 155155360Sobrien a substitute for it. The only questionable case is Solaris 155255360Sobrien 2.6, which lacks btowc but does support UTF8. However, 2.6 155355360Sobrien supports UTF8 but only as a demonstration (for an English 155455360Sobrien locale!); Japanese Solaris 2.6 users typically use EUC, or 155555360Sobrien sometimes shift-JIS, but they cannot use UTF8 since Japanese 155655360Sobrien UTF8 is not supported. Hence there's no point to having grep 155755360Sobrien substitute a btowc that uses UTF8, as it is either redundant, 155855360Sobrien or it will almost invariably have incorrect behavior. 155955360Sobrien 156055360Sobrien * configure.in (AC_CHECK_HEADERS): Don't set USE_WCHAR. 156155360Sobrien (AC_CHECK_FUNCS): Add btowc, wctype. 156255360Sobrien (AC_REPLACE_FUNCS): Don't replace btowc; our replacement is 156355360Sobrien invariably doing the wrong thing anyway, at least on SunOS/Solaris. 156455360Sobrien Don't bother to check for wctype in -lw, as we don't support 156555360Sobrien wide characters on Solaris 2.5.1 or earlier anyway. 156655360Sobrien 156755360Sobrien * bootstrap/Makefile.try (OBJS): Remove btowc.$(OBJEXT). 156855360Sobrien 156955360Sobrien * src/btowc.c: Removed; no longer needed. 157055360Sobrien 157155360Sobrien1999-02-19 Paul Eggert 157255360Sobrien 157355360Sobrien * NEWS: Fix typo when talking about the old behavior of 157455360Sobrien silently skipping directories; it was grep 2.1, not grep 2.2. 157555360Sobrien 157655360Sobrien1999-02-15 Alain Magloire 157755360Sobrien 157855360Sobrien * bootstrap/Makefile.try : add DJGPP DEFS. 157955360Sobrien Done by Elie Zaretsckii. 158055360Sobrien 158155357Sobrien1999-02-14 Alain Magloire 158255357Sobrien 158355357Sobrien * m4/gettext.m4 : Guard [] with changequote. 158455357Sobrien From Elie Zaretskii. 158555357Sobrien 158655357Sobrien * djgpp/config.bat : Makefile.in.in --> Makefile.in-in 158755357Sobrien From Elie Zaretskii. 158855357Sobrien 158955357Sobrien * src/dosbuf: k&r function parameter. 159055357Sobrien 159155357Sobrien * release of 2.3. 159255357Sobrien 159355357Sobrien1999-02-10 Alain Magloire 159455357Sobrien 159555357Sobrien * bootstrap/{Makefile{try,am},REAMDE} : skeleton 159655357Sobrien provided for system lacking the tools to autoconfigure. 159755357Sobrien 159855357Sobrien * src/{e,f,}grepmat.c: added guard [HAVE_CONFIG_H] 159955357Sobrien 160055357Sobrien1999-02-10 Alain Magloire 160155357Sobrien 160255357Sobrien * PATCHES-AC, PATCHES-AM: updated. 160355357Sobrien 160455357Sobrien * m4/regex.m4 : updated. 160555357Sobrien 160655357Sobrien1999-02-05 Eli Zaretskii 160755357Sobrien 160855357Sobrien * m4/gettext.m4 : Support DOS-style D:/foo/bar absolute file 160955357Sobrien names. 161055357Sobrien 161155357Sobrien * aclocal.m4 (DJGPP) : Use $DJ_GPP instead, since changing the 161255357Sobrien latter prevents GCC from finding headers and libraries. 161355357Sobrien 161455357Sobrien * djgpp/config.bat: Make building from another directory work 161555357Sobrien 161655357Sobrien * djgpp/config.sed: Remove redundant command wich edited path 161755357Sobrien separator: now done by configure. 161855357Sobrien 161955357Sobrien * src/grep.c [O_BINARY]: Add prototype for undossify_input. 162055357Sobrien 162155357Sobrien * doc/grep.texi (Introduction): Typo fixed. 162255357Sobrien 162355357Sobrien1999-02-03 Alain Magloire 162455357Sobrien 162555357Sobrien * grep-2.2f beta release. 162655357Sobrien 162755357Sobrien1999-02-02 Alain Magloire 162855357Sobrien 162955357Sobrien * m4/{djgpp,envsep,glibc,regex,dosfile,isc-posix}.m4 : 163055357Sobrien New files to aid configuration and unload configure.in. 163155357Sobrien * m4/Makefile.am : updated. 163255357Sobrien * src/btowc.c : protect for wchar.h 163355357Sobrien 163455357Sobrien1999-01-28 Alain Magloire 163555357Sobrien 163655357Sobrien * intl/Makefile.in: Replace .o with .${ac_objext} where necessary. 163755357Sobrien Work around a limitation of Visual C++ on Cygwin32. 163855357Sobrien * acconfig.h configure.in: Define `alloca' as `_alloca' when CC=cl. 163955357Sobrien This little hack was suggested by Ian Roxborough <irox@cygnus.com>. 164055357Sobrien Patch forwarded by Ben Elliston. 164155357Sobrien 164255357Sobrien1999-01-28 Alain Magloire 164355357Sobrien 164455357Sobrien * PATCHES-AM: New file. A small patch for automake-1.4, use $(sep) 164555357Sobrien as the path separator base on @SEP@. 164655357Sobrien * PATCHES-AC configure.in : updated for autoconf-13. 164756230Sru 164855357Sobrien1999-01-27 Volker Borchert 164955357Sobrien 165055357Sobrien * grep.c: fgrep -NUM not working correctly. 165155357Sobrien add the argument number to digit_args_val. 165255357Sobrien 165355357Sobrien1999-01-22 Paul Eggert 165455357Sobrien 165555357Sobrien Prevent grep -r from recursing infinitely through directory loops via 165655357Sobrien symbolic links. 165755357Sobrien 165855357Sobrien * grep.c (struct stats): New type. 165955357Sobrien (stats_base): New var. 166055357Sobrien (bufstat): Remove; subsumed by stats->stat. 166155357Sobrien (reset, fillbuf, grep, grepdir, grepfile): Pass struct stats * arg, 166255357Sobrien for directory loop checking; use this instead of the bufstat global. 166355357Sobrien All callers changed. 166455357Sobrien (grepfile): Stat the file before invoking grepdir. 166555357Sobrien (grepdir): Assume that the argument has already been statted. 166655357Sobrien No longer a need for a directory size argument, since it 166755357Sobrien can be gotten from the struct stats * argument. 166855357Sobrien Check for directory loops. 166955357Sobrien Create linked list of directories currently being visited, 167055357Sobrien to detect loops. 167155357Sobrien 167255357Sobrien1998-12-29 Kaveh R. Ghazi 167355357Sobrien 167455357Sobrien intl/localealias.c: When building grep-2.2e using cc on Irix4, 167555357Sobrien I needed the following patch to intl/localealias.c. 167655357Sobrien (Its the same patch used by fileutils-4.0.) The patch resolves 167755357Sobrien conflicts between char* and unsigned char* in the i18n code. 167855357Sobrien 167955357Sobrien1998-12-10 Alain Magloire 168055357Sobrien 168155357Sobrien * src/grep.c : Typo in contex -->context 168255357Sobrien Noted by Vladimir Michl. 168355357Sobrien 168455357Sobrien1998-12-01 Alain Magloire 168555357Sobrien 168655357Sobrien * doc/Makefile.am djgpp/Makefile.am m4/Makefile.am vms/Makefile.am: 168755357Sobrien New files. 168855357Sobrien 168955357Sobrien * m4/progtest.m4: proctect '[]' from m4. 169055357Sobrien Noted by Eli Z. 169155357Sobrien 169255357Sobrien * PATCHES-AC: New file, add the patch for autoconf in the dist. 169355357Sobrien 169455357Sobrien * acconfig.h: (HAVE_DOS_FILENAME) 169555357Sobrien 169655357Sobrien * TODO: updated. 169755357Sobrien 169855357Sobrien * src/search.c: remove obsolete 'gegrep,ggrep,gnugrep' 169955357Sobrien matchers. grep no longer depend on argv[0]. 170055357Sobrien 170155357Sobrien * grep-2.2e beta to test DJGPP port. 170255357Sobrien 170355357Sobrien1998-11-28 Paul Eggert 170455357Sobrien 170555357Sobrien Various portability enhancements: 170655357Sobrien - Don't assume that O_BINARY implies DOS. Use separate 170755357Sobrien macros D_OK (for DOS-like directory access) and 170855357Sobrien HAVE_DOS_FILE_NAMES (for DOS-like file names). 170955357Sobrien - Don't assume that off_t fits into long; it doesn't on Solaris 2.6. 171055357Sobrien - Have is_EISDIR set errno properly on hosts with screwed-up EISDIR. 171155357Sobrien - Treat ':' specially in DOS file names only if it's the end of a 171255357Sobrien drive specifier. 171355357Sobrien - Protect against errno < 0. 171455357Sobrien 171555357Sobrien * src/grep.c (is_EISDIR): Move defn to system.h. 171655357Sobrien (print_offset_sep): New function. 171755357Sobrien (fillbuf): Remove redundant test of O_BINARY. 171855357Sobrien (totalcc, totalnl): Now of type off_t. 171955357Sobrien (prline): Use print_offset_sep to print file offsets. 172055357Sobrien (grepfile): Don't set e to EISDIR; that's is_EISDIR's responsibility 172155357Sobrien on machines that don't work properly with EISDIR. 172255357Sobrien (grepdir): Don't assume ':' means slash on all DOS filenames; 172355357Sobrien it means it only in the file prefix. 172455357Sobrien 172555357Sobrien * src/system.h (strerror): Check for negative error numbers. 172655357Sobrien (is_EISDIR): Depend on D_OK, not O_BINARY. 172755357Sobrien (SET_BINARY): Depend on HAVE_SETMODE, not __DJGPP__. 172855357Sobrien (IS_SLASH, FILESYSTEM_PREFIX_LEN): Depend on HAVE_DOS_FILE_NAMES, 172955357Sobrien not O_BINARY. 173055357Sobrien (CHAR_BIT): New macro. 173155357Sobrien 173255357Sobrien * src/dosbuf.c (struct dos_map): 173355357Sobrien pos and add members are now of type off_t. 173455357Sobrien (dos_stripped_crs): Now of type off_t. 173555357Sobrien (dossified_pos): Now accepts arg and returns value of type off_t. 173655357Sobrien 173755357Sobrien * configure.in (AC_CHECK_FUNCS): Add setmode. 173855357Sobrien (HAVE_DOS_FILENAMES): New macro 173955357Sobrien 174055357Sobrien1998-11-27 Eli Zaretskii 174155357Sobrien 174255357Sobrien * djgpp/config.sed: New file, a Sed script to edit configure 174355357Sobrien script before running it on DOS/Windows. 174455357Sobrien * djgpp/config.bat: Updated to handle po2tbl.sed.in and 174555357Sobrien po/Makefile.in.in on DOS filesystems, and to run config.sed. 174655357Sobrien 174755357Sobrien1998-11-24 Jim Meyering 174855357Sobrien 174955357Sobrien * src/grep.c : Typo s/infalid/invalid/ 175055357Sobrien Also noted by Stanislav Brabec. 175155357Sobrien 175255357Sobrien1998-11-24 Eli Zaretskii 175355357Sobrien 175455357Sobrien * doc/grep.texi: I found and corrected several typos. 175555357Sobrien I believe the GNU standards require the section that describes the 175655357Sobrien options to the programs to be called ``Invoking'' or ``Invoking 175755357Sobrien <program-name>''. This is so users and programs can easily find 175855357Sobrien that node in any Info file. So I changed the name of the 175955357Sobrien `Options' chapter to `Invoking', and corrected the 176055357Sobrien cross-references accordingly. 176155357Sobrien I added some markup to things like file names and options. 176255357Sobrien I added some additional index entries where that seemed useful. 176355357Sobrien I also corrected some index entries, such as "@cindex [:alnum:]", 176455357Sobrien which used a colon in them (the colons confuse Info readers). 176555357Sobrien 176655357Sobrien1998-11-24 Alain Magloire 176755357Sobrien 176855357Sobrien * grep/doc/grep.texi : -h is not use for help. 176955357Sobrien Nit spotted by Jim Meyering. 177055357Sobrien 177155357Sobrien1998-11-23 Alain Magloire 177255357Sobrien 177355357Sobrien * doc: New directory, grep.1, {e,f}grep.man move here 177455357Sobrien * doc/grep.texi: New info manual 177555357Sobrien * doc/version.texi: New 177655357Sobrien * doc/Makefile.am: New 177755357Sobrien * tests/{ere,bre}.*: New files. The spencer2 test is split 177855357Sobrien in two ere/bre. 177955357Sobrien * config.hin: New, config.h.in rename to config.hin for OS 178055357Sobrien with limited file system aka DOS. 178155357Sobrien 178255357Sobrien * grep-2.2d release for beta. 178355357Sobrien 178455357Sobrien1998-11-18 Alain Magloire 178555357Sobrien 178655357Sobrien * src/regex.[ch] : Updated from GLibc, previous patches were 178755357Sobrien integrate by Ulrich Drepper and some added ones. 178855357Sobrien 178955357Sobrien1998-11-16 Paul Eggert 179055357Sobrien 179155357Sobrien * grep.h (__attribute__): New macro, if not GCC. 179255357Sobrien (fatal): Add __attribute__((noreturn)). 179355357Sobrien * grep.c (usage): Add __attribute__((noreturn)). 179455357Sobrien 179555357Sobrien1998-11-16 Paul Eggert 179655357Sobrien 179755357Sobrien Remove memory leak with valloced buffers, by invoking malloc instead. 179855357Sobrien 179955357Sobrien * configure.in (AC_CHECK_FUNCS), src/system.h (valloc): Remove. 180055357Sobrien * src/grep.c (page_alloc): New function. 180155357Sobrien (ubuffer, pagesize): New vars. 180255357Sobrien (ALIGN_TO): New macro. 180355357Sobrien (reset): Initialize new vars. Check for overflow in buffer size calc. 180455357Sobrien Use page_alloc instead of valloc. 180555357Sobrien (fillbuf): Likewise. Use memcpy to copy saved area. 180655357Sobrien 180755357Sobrien1998-11-15 Paul Eggert 180855357Sobrien 180955357Sobrien * dfa.c (dfacomp), search.c (EGexecute): Don't assume char is unsigned. 181055357Sobrien 181155357Sobrien1998-11-14 Paul Eggert 181255357Sobrien 181355357Sobrien * src/grep.c (grepdir): Fix bug: memory freed twice. 181455357Sobrien 181555357Sobrien * src/search.c (Gcompile, Ecompile): Don't invoke dfainit, 181655357Sobrien since dfacomp does it for us, and if we also do it then we 181755357Sobrien leak memory. 181855357Sobrien 181955357Sobrien1998-11-13 Eli Zaretskii 182055357Sobrien 182155357Sobrien * djgpp/config.bat: Rewrite to run the configure script via Bash. 182255357Sobrien * djgpp/config.site, djgpp/getconf: New files. 182355357Sobrien * djgpp/config.h, djgpp/*.mak, djgpp/po2tbl.sed: Remove. 182455357Sobrien * djgpp/README: Update instructions. 182555357Sobrien 182655357Sobrien * Makefile.am (EXTRA_DIST): Update the list of DJGPP files. 182755357Sobrien 182855357Sobrien * src/system.h (IS_SLASH): New macro. 182955357Sobrien (is_EISDIR): Define it here for DOS and Windows. 183055357Sobrien 183155357Sobrien * src/grep.c (main) [O_BINARY]: Set stdout to binary mode, so the 183255357Sobrien EOL formats of the input and output files match, unless stdout is 183355357Sobrien the console device. 183455357Sobrien (is_EISDIR): Don't define if already defined. Accept a second 183555357Sobrien argument, the file name; all callers changed. 183655357Sobrien (grepdir): Don't free `file', inside the loop. Use IS_SLASH to 183755357Sobrien check whether `dir' needs a slash. 183855357Sobrien (grepfile): If file is a directory, set e to EISDIR. 183955357Sobrien 184055357Sobrien1998-11-10 Alain Magloire 184155357Sobrien 184255357Sobrien * src/vms_fab.{c,h}: New file for VMS wildcard expansion 184355357Sobrien Written by Phillip C. Brisco. 184455357Sobrien 184555357Sobrien * vms/make.com : add line to compile vms_fab.c and 184655357Sobrien {e,f,}grepmat.c with link for each grep/fgrep/egrep. 184755357Sobrien Base on patch send by Phillib C. Brisco. 184855357Sobrien 184955357Sobrien1998-11-09 Alain Magloire 185055357Sobrien 185155357Sobrien * grep-2.2c on alpha for testing. 185255357Sobrien 185355357Sobrien1998-11-09 Paul Eggert 185455357Sobrien 185555357Sobrien * src/grep.1: Fix `Last Change' of output by generating the date 185655357Sobrien from the RCS Id. 185755357Sobrien 185855357Sobrien * src/grep.c (is_EISDIR): New macro. 185955357Sobrien (grep): If -s, suppress errors from trying to read directories. 186055357Sobrien (grepfile): Use is_EISDIR to simplify code. 186155357Sobrien (grepdir): If -s, suppress errors from trying to read directories. 186255357Sobrien 186355357Sobrien * src/grep.1: Fix -q -r -s problems; describe BSD grep better. 186455357Sobrien 186555357Sobrien * src/grep.c (main): Update copyright. 186655357Sobrien 186755357Sobrien Specify default matcher with default_matcher extern var, not 186855357Sobrien DEFAULT_MATCHER macro. This is more straightforward and means 186955357Sobrien we need to compile grep.c just once. 187055357Sobrien 187155357Sobrien * src/egrepmat.c, src/fgrepmat.c, src/grepmat.c: New files. 187255357Sobrien 187355357Sobrien * src/Makefile.am (base_sources): New macro. 187455357Sobrien (egrep_SOURCES, fgrep_SOURCES, grep_SOURCES): Now consist of 187555357Sobrien $(base_sources) plus the single tailoring file. 187655357Sobrien (grep_LDADD, egrep_LDADD, fgrep_LDADD): Remove. 187755357Sobrien (EXTRA_DIST): Remove grep.c, regex.c. 187855357Sobrien (fgrep.o, egrep.o): Remove. 187955357Sobrien 188055357Sobrien * src/grep.h (matcher): Now char const *. 188155357Sobrien (default_matcher): New decl. 188255357Sobrien 188355357Sobrien * src/grep.c (matcher): Now char const *. 188455357Sobrien (setmatcher): Now accepts char const *. 188555357Sobrien (main): Default the matcher from default_matcher (linked externally) 188655357Sobrien rather than DEFAULT_MATCHER (a macro). 188755357Sobrien 188855357Sobrien1998-11-08 Alain Magloire 188955357Sobrien 189055357Sobrien * src/grep.1: `prep.ai.mit.edu' should be replaced with `gnu.org'. 189155357Sobrien Nit from Paul Eggert. 189255357Sobrien 189355357Sobrien1998-11-06 Alain Magloire 189455357Sobrien 189555357Sobrien * src/grep.c: The Matcher is not set to argv[0] but 189655357Sobrien explicitly by a #define MATCHER at compile time default is "grep". 189755357Sobrien 189855357Sobrien * aclocal/: NEW dir. provides our own *.m4 189955357Sobrien 190055357Sobrien * configure.in: Move Paul's Large Files to AC_LFS.(aclocal/lfs.m4) 190155357Sobrien Taken from Jim Meyering fileutils. 190255357Sobrien 190355357Sobrien1998-11-05 Alain Magloire 190455357Sobrien 190555357Sobrien * src/grep.1: update the man pages according to the 190655357Sobrien changes make by Miles. 190755357Sobrien 190855357Sobrien * po/*.po: updated. 190955357Sobrien 191055357Sobrien * first beta release for 2.3 (2.2a). 191155357Sobrien 191255357Sobrien1998-11-04 Miles Bader 191355357Sobrien 191455357Sobrien * src/grep.c (main): Rationalize interaction of -C/-NUM/-A/-B 191555357Sobrien options, and allow -C to have an optional argument. -NUM can 191655357Sobrien now be mixed with -C, and -A, -B always take precedence over 191755357Sobrien -C/-NUM, regardless of order. 191855357Sobrien (long_options): Let -C/--context take an optional argument. 191955357Sobrien 192055357Sobrien1998-11-03 Alain Magloire 192155357Sobrien 192255357Sobrien * src/dfa.c: HP-UX define clrbit/setbit as macros in <sys/param.h> 192355357Sobrien #undef if defined. 192455357Sobrien Fixed by Andreas Ley and Philippe Defert. 192555357Sobrien 192655357Sobrien * src/grep.1 : mention that -s follows POSIX.2 behavior. 192755357Sobrien Noted by Paul Eggert and others. 192855357Sobrien 192955357Sobrien * tests/khadafy.sh: a typo in failure(s). 193055357Sobrien Spotted By Sotiris Vassilopoulos. 193155357Sobrien 193255357Sobrien1998-11-01 Paul Eggert 193355357Sobrien 193455357Sobrien * src/system.h (IN_CTYPE_DOMAIN): New macro. 193555357Sobrien (ISALPHA, ISUPPER, ISLOWER, ISDIGIT, ISXDIGIT, ISSPACE, 193655357Sobrien ISPUNCT, ISALNUM, ISPRINT, ISGRAPH, ISCNTRL): Use 193755357Sobrien IN_CTYPE_DOMAIN instead of isascii. 193855357Sobrien 193955357Sobrien1998-08-18 Paul Eggert 194055357Sobrien 194155357Sobrien Add support for new -r or --recursive (or -d recurse or 194255357Sobrien --directories=recurse) option. 194355357Sobrien 194455357Sobrien * src/Makefile.am (grep_SOURCES): Add savedir.c, savedir.h, stpcpy.c. 194555357Sobrien 194655357Sobrien * src/grep.1: Describe new options. 194755357Sobrien 194855357Sobrien * src/grep.c: Include "savedir.h". 194955357Sobrien (long_options): Add -r or --recursive. 195055357Sobrien (RECURSE_DIRECTORIES): New enum value. 195155357Sobrien (IS_DIRECTORY_ERRNO): Remove. 195255357Sobrien (reset, grep): Add file name arg. 195355357Sobrien (grepdir, grepfile): New functions. 195455357Sobrien (initial_bufoffset): New var. 195555357Sobrien (reset): Initialize it. 195655357Sobrien (fillbuf): Use it. 195755357Sobrien (count_matches, list_files, no_filenames, suppress_errors): New static 195855357Sobrien vars; formerly were local to `main'. 195955357Sobrien (grep): Recurse through directories if the user asks for this. 196055357Sobrien (usage, main): Add new options. 196155357Sobrien (main): Change some local vars to be static, as described above. 196255357Sobrien Move most of the guts into grepfile function. 196355357Sobrien so that it can be recursed through. 196455357Sobrien 196555357Sobrien * configure.in (AC_HEADER_DIRENT, AC_FUNC_CLOSEDIR_VOID): Add. 196655357Sobrien (AC_REPLACE_FUNCS): Add stpcpy. 196755357Sobrien 196855357Sobrien * src/savedir.c, src/savedir.h, src/stpcpy.c: New files; 196955357Sobrien taken from fileutils 3.16u. 197055357Sobrien 197155357Sobrien1998-08-11 Paul Eggert 197255357Sobrien 197355357Sobrien * src/system.h (initialize_main): New macro. 197455357Sobrien * src/grep.c (main): Invoke initialize_main first thing. 197555357Sobrien 197655357Sobrien1998-04-29 Paul Eggert 197755357Sobrien 197855357Sobrien * NEWS, src/grep.1: Describe new -a and -d options. 197955357Sobrien 198055357Sobrien * src/grep.c (long_options, usage, main): 198155357Sobrien New options -d or --directories and -a or --text. 198255357Sobrien (directories, always_text): New variables. 198355357Sobrien (IS_DIRECTORY_ERRNO): New macro. 198455357Sobrien (reset): Now returns value specifying whether to skip this file. 198555357Sobrien Stat the file if either mmap or directory-skipping is possible. 198655357Sobrien Skip the file if it's a directory and we're skipping directories. 198755357Sobrien (grep): Skip the file if `reset' tells us to. 198855357Sobrien (main): If open fails because the file is a directory, and if we're 198955357Sobrien skipping directories, don't report an error. 199055357Sobrien Remove special case for DOS and Windows. 199155357Sobrien 199255357Sobrien * src/dosbuf.c (guess_type): Use the same method for guessing whether a 199355357Sobrien file is binary as grep.c's grep does. 199455357Sobrien There's no longer any need to declare `bp' to be unsigned. 199555357Sobrien 199655357Sobrien1998-04-26 Alain Magloire 199755357Sobrien 199855357Sobrien * grep-2.2 release. 199955357Sobrien 200055357Sobrien * src/dfa.c: Wrong revision was pulled out 200155357Sobrien for beta 2.1.1d. 200255357Sobrien * src/search.c: Wrong revision was pulled out 200355357Sobrien for beta 2.1.1d. 200455357Sobrien 200555357Sobrien * src/grep.c: ck_atoi () added instead of atoi (). 200655357Sobrien Suggestion from Jim Meyering. 200755357Sobrien ck_atoi () pulled from diffutils-2.7, maintained by Paul Eggert. 200855357Sobrien 200955357Sobrien * AUTHORS: Rephrase of some sentences. 201055357Sobrien * README: Rewording. 201155357Sobrien Noted and patched by Joel N. Weber II. 201255357Sobrien 201355357Sobrien1998-04-17 Kaveh R. Ghazi 201455357Sobrien 201555357Sobrien * src/dfa.h: Don't define `const', trust autoconf to handle it. 201655357Sobrien 201755357Sobrien1998-04-16 Alain Magloire 201855357Sobrien 201955357Sobrien * tests/{status,empty}.sh: wrong return status. 202055357Sobrien 202155357Sobrien * src/grep.c: Remove the REGEX part in usage (), it was 202255357Sobrien consider overkill by most. 202355357Sobrien 202455357Sobrien1998-04-14 Eli Zaretskii 202555357Sobrien 202655357Sobrien * djgpp/config.bat: Support file names with multiple dots on all 202755357Sobrien platforms. 202855357Sobrien 202955357Sobrien * djgpp/README: Add instructions about file names illegal on 203055357Sobrien MS-DOS. 203155357Sobrien 203255357Sobrien1998-04-13 Alain Magloire 203355357Sobrien 203455357Sobrien * src/dfa.c: by "popular" demand reverse 203555357Sobrien back to '_' not word-constituent. 203655357Sobrien 203755357Sobrien * grep-2.1.1c available for testing. 203855357Sobrien 203955357Sobrien1998-04-13 Karl Heuer 204055357Sobrien 204155357Sobrien * src/grep.c: (a) The directory check is done too early: 204255357Sobrien logically, if the argument is "-", then it refers to standard 204355357Sobrien input, regardless of whether there's something in the file 204455357Sobrien system answering to "-". 204555357Sobrien (b) The sh command "grep -l root /etc/passwd /etc/group 0<&-" 204655357Sobrien prints "(standard input)" instead of "/etc/passwd", because it 204755357Sobrien mistakenly believes that a named file will never be opened on fd 204855357Sobrien 0. The string "(standard input)" should be based on the file 204955357Sobrien having been originally specified as "-", rather than making 205055357Sobrien assumptions about the fd. 205155357Sobrien (c) the code that calls close(fd) is being done outside of the 205255357Sobrien test for a bad fd. Thus, if the open failed, this code will 205355357Sobrien attempt to close(-1). It should be done inside the "fd != -1" 205455357Sobrien branch. 205555357Sobrien This patch addresses all three of these problems. 205655357Sobrien 205755357Sobrien1998-04-13 Alain Magloire 205855357Sobrien 205955357Sobrien * configure.in: remove the deprecated AC_ISC_POSIX macro. 206055357Sobrien Spotted by Karl Heuer. 206155357Sobrien 206255357Sobrien1998-04-03 Eli Zaretskii 206355357Sobrien 206455357Sobrien * djgpp/main.mak, djgpp/src.mak, djgpp/tests.mak: Updated from the 206555357Sobrien relevant Makefile.in files. 206655357Sobrien 206755357Sobrien * djgpp/config.bat: Create files in intl directory like the 206855357Sobrien configure script does. 206955357Sobrien 207055357Sobrien1998-03-28 Eli Zaretskii 207155357Sobrien 207255357Sobrien * djgpp/main.mak, djgpp/src.mak, djgpp/tests.mak: Updated to track 207355357Sobrien changes in respective Makefile.in files. 207455357Sobrien 207555357Sobrien * src/dosbuf.c (guess_type): Avoid running off the end of the 207655357Sobrien buffer. Spotted by Paul Eggert. 207755357Sobrien 207855357Sobrien1998-03-27 Alain Magloire 207955357Sobrien 208055357Sobrien * grep-2.1.1b.tar.gz available. 208155357Sobrien 208255357Sobrien * src/regex.c: CLASS_CHAR_MAX set to 256 instead of 6 208355357Sobrien when WCTYPE and WCHAR are not defined. When class names 208455357Sobrien where bigger then 6, it will not detect an error. 208555357Sobrien example '[[:alphabet:]]'. 208655357Sobrien 208755357Sobrien * Updated the copyright of the files with emacs. 208855357Sobrien With emacs Jim :). 208955357Sobrien 209055357Sobrien1998-03-26 Jim Meyering 209155357Sobrien 209255357Sobrien * src/dfa.c (IS_WORD_CONSTITUENT): Define. 209355357Sobrien (lex): Use IS_WORD_CONSTITUENT, not ISALNUM. 209455357Sobrien Don't special-case '_'. 209555357Sobrien (dfastate): Use IS_WORD_CONSTITUENT, not ISALNUM. 209655357Sobrien (dfaexec): Likewise. 209755357Sobrien 209855357Sobrien1998-03-25 Alain Magloire 209955357Sobrien 210055357Sobrien * tests/warning.sh: typos and replace the echos with 210155357Sobrien a simple cat. 210255357Sobrien Noted By Jim Meyering. 210355357Sobrien 210455357Sobrien * src/regex.c: #undef ISASCII and ISPRINT before defining 210555357Sobrien them(On Solaris it was define). 210655357Sobrien Pattern 'a[[:]:]]b' is an invalid char class and the error 210755357Sobrien from regex was 1(REG_NOMATCH) instead of 2 (REG_ECTYPE). 210855357Sobrien Fix with help from Ulrich Drepper. 210955357Sobrien 211055357Sobrien * src/grep.c (usage): Ulrich wrote: "A single printf should 211155357Sobrien not have more than 900 bytes. For translation reasons the 211255357Sobrien text shouldn't be split in too many pieces since this is 211355357Sobrien tiresome and also does not help to generate a consistent picture." 211455357Sobrien Noted by Ulrich Drepper. 211555357Sobrien * src/grep.c (usage): Dig out and old patch from 211655357Sobrien Franc,ois to explain the regex in usage(). 211755357Sobrien Ideas from Franc,ois Pinard. 211855357Sobrien 211955357Sobrien1998-03-23 Alain Magloire 212055357Sobrien 212155357Sobrien * testing: grep-2.1.1a for testing. 212255357Sobrien 212355357Sobrien * configure.in: Solaris needs '-lw' if we use wchar/wctype 212455357Sobrien functions. 212555357Sobrien * src/btowc.c: New file from GNU libc. Solaris 2.5 don't 212655357Sobrien have it define. 212755357Sobrien * configure.in : check for btowc (). 212855357Sobrien 212955357Sobrien * regex.c: Include <wchar.h> before <wctype.h>, to work around 213055357Sobrien a Solaris 2.5 bug. 213155357Sobrien Patch provided by Paul Eggert. 213255357Sobrien 213355357Sobrien * tests/status.sh: new file to check return status code. 213455357Sobrien * tests/empty.sh: new file to check for empty pattern. 213555357Sobrien * tests/warning.sh: new file to tell where to report errors. 213655357Sobrien 213755357Sobrien * configure.in: If available, prefer support for large files 213855357Sobrien unless the user specified one of the CPPFLAGS, LDFLAGS, or LIBS 213955357Sobrien variables. 214055357Sobrien Done by Paul Eggert. 214155357Sobrien 214255357Sobrien * src/grep.c (usage): change prep.ai.mit.edu for gnu.org. 214355357Sobrien 214455357Sobrien1998-03-18 Alain Magloire 214555357Sobrien 214655357Sobrien * src/grep.c (usage): Formating the --help message a bit off. 214755357Sobrien Noted by William Bader. 214855357Sobrien 214955357Sobrien * src/grep.c (main): When checking conflicting matcher for option -E the 215055357Sobrien matcher was to "egrep" instead of "posix-egrep". 215155357Sobrien Reported by kwzh@gnu.org. 215255357Sobrien 215355357Sobrien * src/grep.c: Typos and rewording the --help message. 215455357Sobrien Reported by Karl Heuer. 215555357Sobrien 215655357Sobrien * src/grep.1: The man page wording : 215755357Sobrien A regular expression matching a single character may be 215855357Sobrien followed by one of several repetition operators: 215955357Sobrien is unclear since 'x(yz)*z' is a valid regex. 216055357Sobrien Remove the "matching a single character". 216155357Sobrien Suggested by Harald Hanche-Olsen. 216255357Sobrien 216355357Sobrien * src/grep.c (main): `-f /dev/null' now specifies no patterns 216455357Sobrien and therfore matches nothing. 216555357Sobrien Reported by Jorge Stolfi. 216655357Sobrien Patched by Paul Eggert. 216755357Sobrien 216855357Sobrien1998-03-10 Alain Magloire 216955357Sobrien 217055357Sobrien * Ice storm 98(el nino). Lost grep repository disk, 217155357Sobrien and my $HOME directory, etc .. 217255357Sobrien Trying to get the emails/patch from dejanews.com 217355357Sobrien and start from grep-2.1. 217455357Sobrien sigh .... 217555357Sobrien 217655357Sobrien1997-11-01 Alain Magloire 217755357Sobrien 217855357Sobrien * src/grep.c: For the long options, the problems are: 217955357Sobrien --file appears in the option table as 'no_argument' 218055357Sobrien instead of 'required_argument'. 218155357Sobrien --files-with-matches is missing from the option table. 218255357Sobrien The help lists '--fixed-strings' as the long option for -F, 218355357Sobrien the table has '--fixed-regexp'. 218455357Sobrien --regexp appears in the option table as 'no_argument' 218555357Sobrien instead of 'required_argument'. 218655357Sobrien --with-filename is missing from the option table. 218755357Sobrien Reported by Grant McDorman and Krishna Sethuraman. 218855357Sobrien 218955357Sobrien1997-10-19 Alain Magloire 219055357Sobrien 219155357Sobrien * src/grep.c: the option "with-filename was not in the arg table. 219255357Sobrien Corrected by Jim Hand. 219355357Sobrien 219455357Sobrien * GNU gettext library from gettext-0.10.32. 219555357Sobrien 219655357Sobrien * src/grep.c: reverse back to greping directories, 219755357Sobrien One could skip the error message by defining 219855357Sobrien SKIP_DIR_ERROR. There is no clear way of doing 219955357Sobrien things, I hope to setle this on the next majore release 220055357Sobrien Thanks Paul Eggert, Eli Zaretskii and gnits for the 220155357Sobrien exchange. 220255357Sobrien 220355357Sobrien * tests/status.sh: add this check to make sure 220455357Sobrien That the return status code is ok. 220555357Sobrien 220655357Sobrien1997-10-10 Andreas Schwab 220755357Sobrien 220855357Sobrien * src/grep.1: Fix formatting. 220955357Sobrien 221055357Sobrien * configure.in: Check for wctype.h, wchar.h, libintl.h and 221155357Sobrien isascii, which are needed for regex.c. 221255357Sobrien 221355357Sobrien1997-10-01 Paul Eggert 221455357Sobrien 221555357Sobrien * src/grep.c (fillbuf): Don't warn about mmap failures. 221655357Sobrien 221755357Sobrien1997-09-7 Alain Magloire 221855357Sobrien 221955357Sobrien * src/grep.c: added code for -H --with-filename. 222055357Sobrien 222155357Sobrien * djgpp/*: patch wrongly apply 222255357Sobrien duplication of text in djgpp/{README,config.h}. 222355357Sobrien Filter djgpp/config.bat with unix2dos. 222455357Sobrien 222555357Sobrien * djgpp/make.mak: beautify 222655357Sobrien From Eli Zaretskii. 222755357Sobrien 222855357Sobrien * grep-2.1 release. 222955357Sobrien 223055357Sobrien1997-09-01 Alain Magloire 223155357Sobrien 223255357Sobrien * grep-2.0f out for testing. 223355357Sobrien 223455357Sobrien * update to GNU gettext library from gettext-0.10.31 223555357Sobrien 223655357Sobrien * grep.c : have a nicer format for --version. 223755357Sobrien Noted by Ulrich Drepper. 223855357Sobrien 223955357Sobrien * obstack.[ch]: updated from GNU C library 224055357Sobrien * configure.in: look for stdlib.h [HAVE_STDLIB_H] 224155357Sobrien Comments from Ulrich Drepper. 224255357Sobrien 224355357Sobrien1997-08-25 Philippe De Muyter <phdm@info.ucl.ac.be> 224455357Sobrien 224555357Sobrien * src/dfa.c (sys/types.h): File included unconditionnaly. 224655357Sobrien 224755357Sobrien1997-08-16 Eli Zaretskii <eliz@is.elta.co.il> 224855357Sobrien 224955357Sobrien * grep.c (long_options) [O_BINARY]: Add DOS-specific options. 225055357Sobrien (fillbuf) [O_BINARY]: For DOS-style text files, strip CR 225155357Sobrien characters at end of line. 225255357Sobrien (prline) [O_BINARY]: Report correct byte offsets, even though CR 225355357Sobrien characters were stripped when reading the file. 225455357Sobrien (usage) [O_BINARY]: Add DOS-specific options. 225555357Sobrien (setmatcher) [HAVE_SETRLIMIT]: Set re_max_failures so that the 225655357Sobrien matcher won't ever overflow the stack. 225755357Sobrien (main) [__MSDOS__, _WIN32]: Handle backslashes and drive letters 225855357Sobrien in argv[0], remove the .exe suffix, and downcase the prgram name. 225955357Sobrien [O_BINARY]: Pass additional DOS-specific options to getopt_long 226055357Sobrien and handle them. Call stat before attempting to open the file, in 226155357Sobrien case it is a directory (DOS will fail the open call for 226255357Sobrien directories). Switch the input descriptor to binary mode, unless 226355357Sobrien it is a terminal device. 226455357Sobrien 226555357Sobrien * system.h [O_BINARY]: Define macros to switch a handle to binary 226655357Sobrien mode, so binary files could be grep'ed on MS-DOS and MS-Windows. 226755357Sobrien [HAVE_SETLOCALE]: Test for HAVE_SETLOCALE instead of 226855357Sobrien HAVE_LC_MESSAGES, to prevent compilation error in grep.c on 226955357Sobrien systems which don't define HAVE_LC_MESSAGES, but have setlocale. 227055357Sobrien 227155357Sobrien * dosbuf.c: New file, functions specific for MS-DOS/MS-Windows. 227255357Sobrien (guess_type, undossify_input, dossified_pos): New functions. 227355357Sobrien 227455357Sobrien * djgpp/config.h, djgpp/config.bat, djgpp/main.mak, djgpp/src.mak, 227555357Sobrien djgpp/po.mak, djgpp/intl.mak, djgpp/tests.mak, djgpp/po2tbl.sed: 227655357Sobrien New files, for building Grep with DJGPP tools for MS-DOS and 227755357Sobrien MS-Windows. 227855357Sobrien 227955357Sobrien * grep.1: Document DOS-specific switches. 228055357Sobrien 228155357Sobrien1997-08-08 Alain Magloire 228255357Sobrien 228355357Sobrien * grep-2.0e: available for testing 228455357Sobrien 228555357Sobrien * grep.c: change LC_MESSAGE to LC_ALL for (LC_CTYPE). 228655357Sobrien Suggested by Jochen Hein. 228755357Sobrien 228855357Sobrien * ABOUT-NLS: updated. 228955357Sobrien * grep.c: --version: more verbosity (COPYRIGHT). 229055357Sobrien * grep.c: --help: PATTERN, FILE instead of <pattern>, <file>. 229155357Sobrien * INSTALL.grep: not necessary removed. 229255357Sobrien * configure.in: --disable-regex rename --without-include-regex. 229355357Sobrien * THANKS: format: first row name, second email. 229455357Sobrien * ChangeLog: format ISO 8601. 229555357Sobrien Reported by Franc,ois Pinard. 229655357Sobrien 229755357Sobrien * grep.c: move dcl of struct stat st into "else" where it's used. 229855357Sobrien Reported by Jim Meyering. 229955357Sobrien 230055357Sobrien * grep.c: totalnl should be %u in printf. 230155357Sobrien Reported by Michael Aichlmay 230255357Sobrien Corrected with guidance from Ulrich Drepper 230355357Sobrien 230455357Sobrien1997-07-24 Alain Magloire <alainm@rcsm.ee.mcgill.ca> 230555357Sobrien 230655357Sobrien * Makefile.am: corrected an error when installing {f,e}grep.1. 230755357Sobrien From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>. 230855357Sobrien From Ulrich Drepper <drepper@cygnus.com>. 230955357Sobrien 231055357Sobrien * Many files: use PARAMS instead of __STDC__ for prototypes. 231155357Sobrien From Jim Meyering <meyering@eng.ascend.com>. 231255357Sobrien Patch provided by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>. 231355357Sobrien 231455357Sobrien * dfa.[ch]: uses the one in gawk-3.0.3 with the patch from 231555357Sobrien Arnold (see Changelog: July 12 1997) 231655357Sobrien 231755357Sobrien * grep.1: a note to say -l, -L, -q stop on first match. 231855357Sobrien Noted by Andrew Beattie <gaffer@tug.com>. 231955357Sobrien 232055357Sobrien * grep.c: refuse to scan if the file is a directory. 232155357Sobrien This was causing problems on SUNs. If the directory contains 232255357Sobrien a file that could match the pattern, garbage was display. 232355357Sobrien 232455357Sobrien * tests directory: added new set of tests from Henry Spencer 232555357Sobrien regex package. Change the way the tests were done to be more 232655357Sobrien conformant to automake. 232755357Sobrien 232855357Sobrien * configure.in: added --disable-regex for folks with their own fuctions. 232955357Sobrien 233055357Sobrien * grep-20d : available for testing 233155357Sobrien 233255357Sobrien1997-07-18 Alain Magloire <alainm@rcsm.ee.mcgill.ca> 233355357Sobrien 233455357Sobrien * grep-2.0c: available for testing 233555357Sobrien 233655357Sobrien1997-07-17 Alain Magloire <alainm@rcsm.ee.mcgill.ca> 233755357Sobrien 233855357Sobrien * src/grep.c: Cause grep to fail if `fclose (stdout)' fails. 233955357Sobrien From Jim Meyering <meyering@eng.ascend.com>. 234055357Sobrien 234155357Sobrien * grep.c:usage() more consistency in the --help. 234255357Sobrien 234355357Sobrien * egrep, fgrep were links This is in violation of GNU standards: 234455357Sobrien "Please don't make the behavior of a utility depend on the name used 234555357Sobrien to invoke it. It is useful sometimes to make a link to a utility with 234655357Sobrien a different name, and that should not change what it does." 234755357Sobrien For now egrep and fgrep will be copies of grep. A better scheme 234855357Sobrien should be found later. 234955357Sobrien After discussion with Tom Tromey <tromey@cygnus.com>. 235055357Sobrien 235155357Sobrien * fgrep.man and egrep.man included: They are stubs that call grep.1. 235255357Sobrien * Makefile.am: modified to install {f,e,}grep[,.1]. 235355357Sobrien 235455357Sobrien * speed hack for -l, -L: bail out on first match. 235555357Sobrien From Scott Weikart <scott@igc.apc.org>. 235655357Sobrien 235755357Sobrien * *.[ch]: provided prototypes for strict argument checking 235855357Sobrien With the help of Stewart Levin <stew@sep.stanford.edu>. 235955357Sobrien 236055357Sobrien1997-07-16 Alain Magloire <alainm@rcsm.ee.mcgill.ca> 236155357Sobrien 236255357Sobrien * configure.in: typo in the creation of po/Makefile 236355357Sobrien Noted by Volker Borchert bt@teknon.de. 236455357Sobrien 236555357Sobrien * grep-2.0b: make it available for testing. 236655357Sobrien 236755357Sobrien1997-07-15 Alain Magloire <alainm@rcsm.ee.mcgill.ca> 236855357Sobrien 236955357Sobrien * src/grep.c usage(): cut the --help in smaller printf()'s 237055357Sobrien Noted by Ulrich Drepper <drepper@cygnus.com>. 237155357Sobrien 237255357Sobrien1997-07-14 Alain Magloire <alainm@rcsm.ee.mcgill.ca> 237355357Sobrien 237455357Sobrien * grep-2.0a: make an alpha available for testing. 237555357Sobrien 237655357Sobrien1997-07-12 Alain Magloire <alainm@rcsm.ee.mcgill.ca> 237755357Sobrien 237855357Sobrien * run gettextize: added the po directory filled with *.po files. 237955357Sobrien 238055357Sobrien * check.sh, scriptgen.awk: fix grep paths. 238155357Sobrien 238255357Sobrien * change the directory strucure: grep is now in src to comply with 238355357Sobrien gettext.m4. 238455357Sobrien 238555357Sobrien * grep.c version.c [VERSION]: got rid of version.c, 238655357Sobrien it is now define via config.h. 238755357Sobrien 238855357Sobrien * dfa.c: patch to speed up initialization. 238955357Sobrien Arnold Robbins (arnold@gnu.ai.mit.edu). 239055357Sobrien 239155357Sobrien1997-07-09 Alain Magloire <alainm@rcsm.ee.mcgill.ca> 239255357Sobrien 239355357Sobrien * *.c [HAVE_CONFIG_H]: Macro defined. 239455357Sobrien 239555357Sobrien * support for I18N in Makefile.am and configure.in. 239655357Sobrien 239755357Sobrien * update all the string to use gettext(I18N). 239855357Sobrien Help from Franc,ois Pinard previous patch <pinard@IRO.UMontreal.CA>. 239955357Sobrien 240055357Sobrien1997-07-04 Alain Magloire <alainm@rcsm.ee.mcgill.ca> 240155357Sobrien 240255357Sobrien * obstack.[ch]: updated from glibc. 240355357Sobrien Work of Ulrich Drepper <drepper@cygnus.com>. 240455357Sobrien 240555357Sobrien * regex.[ch]: updated from glibc. 240655357Sobrien Work of Ulrich Drepper <drepper@cygnus.com>. 240755357Sobrien 240855357Sobrien * grep.c: for option -e not counting '\n' for new keys. 240955357Sobrien From Mark Waite <markw@mddmew.fc.hp.com>. 241055357Sobrien 241155357Sobrien * grep.c: for option -f allocating the right count. 241255357Sobrien From Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>. 241355357Sobrien Mike Heartel (mike@cs.uoregon.edu). 241455357Sobrien 241555357Sobrien * kwset.c (bmexec): Cast tp[-2] to unsigned char before comparing. 241655357Sobrien From Jim Meyering <meyering@asic.sc.ti.com>. 241755357Sobrien 241855357Sobrien * grep.1: various typos. 241955357Sobrien From Keith Bostic <bostic@bsdi.com>. 242055357Sobrien Mike Heartel (mike@cs.uoregon.edu). 242155357Sobrien 242255357Sobrien1997-06-17 Alain Magloire <alainm@rcsm.ee.mcgill.ca> 242355357Sobrien 242455357Sobrien * grep.c: support for long options. 242555357Sobrien patch done by Franc,ois Pinard <pinard@IRO.UMontreal.CA>. 242655357Sobrien 242755357Sobrien * add getopt1.c in Makefile.am. 242855357Sobrien Noted by Franc,ois Pinard <pinard@IRO.UMontreal.CA> 242955357Sobrien 243055357Sobrien * replace getopt.[ch] and add getopt1.c. 243155357Sobrien 243255357Sobrien * kwset.c: undef malloc before define it. 243355357Sobrien Franc,ois Pinard <pinard@IRO.UMontreal.CA>. 243455357Sobrien 243555357Sobrien1997-06-07 Alain Magloire <alainm@rcsm.ee.mcgill.ca> 243655357Sobrien 243755357Sobrien * grep.c: format incorrect in 243855357Sobrien fprintf("%s: warning: %s: %s...", filename, strerror(errno)). 243955357Sobrien Mike Heartel (mike@cs.uoregon.edu). 244055357Sobrien 244155357Sobrien1996-11-19 David J MacKenzie <djm@catapult.va.pubnix.com> 244255357Sobrien 244355357Sobrien * make.com: Set the logical SYS. From rdb@cocamrd.oz.au (Rodney Brown). 244455357Sobrien 244555357Sobrien * grep.c (S_ISREG): Define if not defined already, for e.g. 244655357Sobrien SunOS 4.0.3. 244755357Sobrien 244855357Sobrien * dfa.c (test_bit, set_bit, clear_bit): Renamed from tstbit, 244955357Sobrien setbit, clrbit to avoid conflict with HP-UX sys/param.h macros. 245055357Sobrien 245155357Sobrien * memchr.c: New file, from GNU libc. 245255357Sobrien * grep.c (memchr): Remove definition. 245355357Sobrien * configure.in: Use AC_REPLACE_FUNCS for memchr. 245455357Sobrien 245555357Sobrien * configure.in: Remove unused checks for memalign and unsigned char. 245655357Sobrien * grep.c: HAVE_WORKING_MMAP -> HAVE_MMAP. 245755357Sobrien 245855357Sobrien * system.h: New file. 245955357Sobrien * dfa.c, kwset.c, grep.c, search.c: Use it instead of duplicating 246055357Sobrien portability boilerplate. 246155357Sobrien 246255357Sobrien * grep.c: Include sys/types.h once, instead of three times 246355357Sobrien conditionally. 246455357Sobrien * dfa.c, kwset.c, search.c: Include sys/types.h unconditionally, 246555357Sobrien to always try to get size_t (needed on some old SysV's). 246655357Sobrien 246755357Sobrien * dfa.c: Define strchr in terms of index, not the other way around. 246855357Sobrien * search.c: Use memcpy instead of bcopy. 246955357Sobrien 247055357Sobrien1996-11-15 David J MacKenzie <djm@catapult.va.pubnix.com> 247155357Sobrien 247255357Sobrien * Many files: Update FSF address. 247355357Sobrien Update configuration to use autoconf v2 and automake. 247455357Sobrien 247555357Sobrien1993-05-22 Mike Haertel <mike@cs.uoregon.edu> 247655357Sobrien 247755357Sobrien * Version 2.0 released. 2478