| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Fixes mmap-anon.m4 conflict with fn_grep, reported by Rainer Orth.
|
|
|
|
|
|
|
| |
* tests/high-bit-range: New test, inspired by an example in the
report by Igor O. Ladygin: http://bugs.debian.org/624387,
via Santiago Ruano Rincón's http://savannah.gnu.org/bugs/?33198
* tests/Makefile.am (TESTS): Add it.
|
|
|
|
|
|
|
| |
* tests/turkish-I: New test.
* tests/Makefile.am (TESTS): Add it.
(XFAIL_TESTS): Add here, too.
Reported by Ilya Basin.
|
|
|
|
|
| |
* doc/grep.in.1: Remove item describing bogus {,m} regex notation.
Reported by Fernando Basso.
|
|
|
|
| |
Run "make update-copyright", so "make syntax-check" works in 2011.
|
|
|
|
| |
* THANKS: Update.
|
|
|
|
|
|
|
|
|
| |
* tests/char-class-multibyte: Use require_en_utf8_locale_,
rather than open-coding it.
* tests/prefix-of-multibyte: Require the locale explicitly.
* tests/fgrep-infloop: Likewise.
This fixes test failures that would arise on systems without
that particular locale. Reported by Ludovic Courtès.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/Makefile.am (grep.1): New rule.
(CLEANFILES): Add grep.1 to the list.
* .gitignore: Add /doc/grep.1
* doc/grep.in.1: Replace hard-coded "2.5.1-cvs" with @VERSION@.
Update copyright year list.
Omit the line-splitting \(co directive so that update-copyright
will perform future updates automatically.
Egmont Koblinger reported the outdated version string
and copyright year list in the man page:
http://savannah.gnu.org/bugs/?29390
|
|
|
|
|
|
|
|
| |
* lib/savedir.c (savedir): Fix logic error. Introduced by commit
bf3bd92c, "build: adapt to the newer exclude API we now get from gnulib"
* tests/include-exclude: Test for this bug by exercising --include, too.
* NEWS (Bug fixes): Mention it.
Reported by Philipp Kohlbecher in http://savannah.gnu.org/bugs/?29358
|
|
|
|
|
|
|
|
| |
* lib/savedir.c (isdir1): Fix fatal typo: deref "dir" argument,
not the global (initially-NULL) "path". Reported by Standish Parsley.
* tests/include-exclude: New file.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
|
|
|
|
|
|
|
|
|
|
| |
This fixes a spurious test failure when "make check" is run with
certain envvars set, e.g., "make check GREP_COLOR=always"
* tests/foad1.sh: Use init.sh and adapt accordingly:
Use "grep", not ${GREP}. Test VERBOSE against "yes", not "1",
to be consistent with init.sh.
Use Exit, not exit.
Reported by Nelson H. F. Beebe.
|
|
|
|
|
|
|
| |
* tests/init.cfg: New file. If either $LOCALE_FR or $LOCALE_FR_UTF8
is set to "none", reset it to the empty string.
Reported by Mike Frysinger and Sven Joachim.
* tests/Makefile.am (EXTRA_DIST): Add init.cfg.
|
|
|
|
|
|
|
|
| |
* src/dfa.c (in_coll_range): Fix ordering for second strcoll. Reported
by Dmitry V. Levin.
* tests/spencer1-locale.awk: Also test single-byte character sets.
* NEWS: Add a note about this bugfix.
* THANKS: Add Dmitry.
|
|
|
|
| |
* THANKS: Update Arnold's name and address, per request.
|
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Add wctob.
* NEWS (Portability): Mention this.
Reported by Dagobert Michelsen in <http://sv.gnu.org/bugs/?29325>.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reported by Jaroslav Škarvada <jskarvad@redhat.com>. This is
unfortunate. grep needs an automatic testcase generator.
* NEWS: Document bug.
* THANKS: Mention reporter.
* src/dfa.c (set_bit_casefold): Change type of first argument for
self-documentation.
(parse_bracket_exp): Fix call.
* tests/Makefile.am: Add new testcase.
* tests/char-class-multibyte: New testcase.
|
|
|
|
| |
* THANKS: Add Eric Blake, who reported the warning fixed by 774d0ee.
|
|
|
|
| |
* THANKS: Jim is now with Red Hat.
|
|
|
|
|
|
| |
Use this command:
git ls-files |grep -vE '^(\..*|COPYING|gnulib)$' |xargs \
env UPDATE_COPYRIGHT_USE_INTERVALS=1 build-aux/update-copyright
|
|
|
|
|
|
| |
Suggested by Johan Walles <johan.walles@gmail.com> (bug 23354).
* src/dfa.c (insert): Use binary search.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* cfg.mk (local-checks-to-skip): Enable sc_trailing_blank.
* AUTHORS: Remove trailing blanks.
* COPYING: Likewise.
* README: Likewise.
* README-alpha: Likewise.
* README-boot: Likewise.
* THANKS: Likewise.
* TODO: Likewise.
* src/dfa.c: Likewise.
* src/mbsupport.h: Likewise.
* tests/backref.sh: Likewise.
* tests/file.sh: Likewise.
* tests/options.sh: Likewise.
* tests/tests: Likewise.
* vms/README: Likewise.
* vms/make.com: Likewise.
|
|
|
|
|
|
| |
* AUTHORS: new maintainers added
* THANKS: same
* README-alpha: change CVS references to Git
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* README-alpha: Mention bug tracking system and grep-devel-list
* src/search.c: Speed up multibyte support (Patch from Tim Waugh)
|
|
|
|
| |
- Fix -i -o combination
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/grep.1: Warn that grep insert a "--" between groups of matches,
when using the context options.
* doc/grep.texi: Likewised.
* configure.in: Add gl in ALL_LINGUAS.
* doc/grep.1: Warn that grep insert a "--" between groups of matches,
when using the context options.
* doc/grep.texi: Likewised.
|
|
|
|
|
|
|
| |
reading of directories and silently ignore them.
* doc/grep.texi: Point out that some Platforms do not support
reading of directories and silently ignore them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patches from Santiago Vila.
2001-07-29 Alain Magloire
David Clissold, wrote:
a small bug in the GNU grep 2.4.2, which may have gone unnoticed
because it only causes a failure if building on a system with large
files enabled (e.g. an "off_t" is a "long long" rather than a "long").
savedir() takes on off_t argument, but in grepdir() the parameter
is cast to an (unsigned). Well, if an off_t is larger than an int,
the value gets truncated. This would not normally have an effect on a
little-endian platform (unless the file is >2GB), but on a big-endian
system it will always fail. The external effect is that
"grep -r foo dir_name" fails with ENOMEM (from malloc() within
savedir()).
* grep/src/grep.c (grepdir): Remove the (unsigned) cast when calling
savedir().
* grep/src/grep.c (usage): Typos corrected.
Patches from Santiago Vila.
David Clissold, wrote:
a small bug in the GNU grep 2.4.2, which may have gone unnoticed
because it only causes a failure if building on a system with large
files enabled (e.g. an "off_t" is a "long long" rather than a "long").
savedir() takes on off_t argument, but in grepdir() the parameter
is cast to an (unsigned). Well, if an off_t is larger than an int,
the value gets truncated. This would not normally have an effect on a
little-endian platform (unless the file is >2GB), but on a big-endian
system it will always fail. The external effect is that
"grep -r foo dir_name" fails with ENOMEM (from malloc() within
savedir()).
* grep/src/grep.c (grepdir): Remove the (unsigned) cast when calling
savedir().
* grep/doc/grep.texi: In Bugs report use {n,m} for consistency.
* grep/doc/grep.1: Likewised.
Noted by Steven Lucy.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Only the Regex patterns should be split in an array, patterns[].
The dfa and KWset compiled patterns should remain global and the
patterns compiled all at once.
* src/search.c : include "error.h" and "xalloc.h" to get prototyping
of x*alloc() and error().
(kwsinit) : Reverse to previous behaviour and takes no argument.
(kwsmusts) : Likewised.
(Gcompile) : For the regex pattern, split them and each pattern
is put in different compiled structure patterns[]. The patterns
are given to dfacomp() and kwsmusts() as is.
(Ecompile) : Likewised.
(Fcompile) : Reverse to the old behaviour of compiling the enire
patterns in one shot.
(EGexecute) : If falling to GNU regex for the matching, loop in the
array of compile patterns[] to find a match.
(error) : Many error () were call with arguments in the wrong order.
* tests/file.sh : Simple test to check for pattern in files.
Reaction to bug report fired by Greg Louis <glouis@dynamicro.on.ca>
In multibyte environments, handle multibyte characters as single
characters in bracket expressions.
* src/dfa.h (mb_char_classes) : new structure.
(mbcsets) : new variable.
(nmbcsets) : new variable.
(mbcsets_alloc) : new variable.
* src/dfa.c (prtok) : handle MBCSET.
(fetch_wc) : new function to fetch a wide character.
(parse_bracket_exp_mb) : new function to handle multibyte character
in lex().
(lex) : invoke parse_bracket_exp_mb() for multibyte bracket expression.
(atom) : handle MBCSET.
(epsclosure) : likewise.
(dfaanalyze) : likewise.
(dfastate) : likewise.
(match_mb_charset) : new function to judge whether a bracket match
with a multibyte character.
(check_matching_with_multibyte_ops) : handle MBCSET.
(dfainit) : initialize new variables.
(dfafree) : free new variables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/grep.texi : Document the new options and the new behaviour
back-references are local. Use excerpt from Karl Berry regex
texinfo.
* bootstrap/Makefile.try : Added xstrtoumax.o xstrtoul.o hard-local.o
From Guglielmo 'bond' Bondioni :
The bug was that using a multi line file that contained REs (one per
line), backreferences in the REs were considered global (to the file)
and not local (to the line).
That is, \1 in line n refers to the first \(.\) in the whole file,
rather than in the line itself.
From Tapani Tarvainen :
# Re: grep -e '\(a\)\1' -e '\(b\)\1'
That's not the way it should work: multiple -e arguments
should be treated as independent patterns and back references
should not refer to previous ones.
From Paul Eggert :
GNU grep currently does not issue
diagnostics for the following two cases, both of which are erroneous:
grep -e '[' -e ']'
grep '[
]'
POSIX requires a diagnostic in both cases because '[' is not a valid
regular expression.
To overcome those problems, grep no longer pass the concatenate
patterns to GNU regex but rather compile each patterns separately
and keep the result in an array.
* src/search.c (patterns) : New global variable; a structure array
holding the compiled patterns.
Declare function prototypes to minimize error.
(dfa, kswset, regexbuf, regs) : Removed, no longer static globals, but
rather fields in patterns[] structure per motif.
(Fcompile) : Alloc an entry in patterns[] to hold the regex.
(Ecompile) : Alloc an entry per motif in the patterns[] array.
(Gcompile) : Likewise.
(EGexecute) : Loop through of array of patterns[] for a match.
From Bernd Strieder :
# tail -f logfile | grep important | do_something_urgent
# tail -f logfile | grep important | do_something_taking_very_long
If grep does full buffering in these cases then the urgent operation
does not happen as it should in the first case, and in the second case
time is lost due to waiting for the buffer to be filled.
This is clearly spoken not grep's fault in the first place, but libc's.
There is a heuristic in libc that make a stream line-buffered only if a
terminal is on the other end. This doesn't take care of the cases where
this connection is somehow indirect.
* src/grep.c (line_buffered) : new option variable.
(prline) : if line_buffered is set fflush() is call.
(usage) : line_buffered new option.
Input from Paul Eggert, doing setvbuf() may not be portable
and breaks grep -z.
This patch prevent kwset_matcher from following problems.
For example, in SJIS encoding, one character has the codepoint 0x895c.
So the second byte of the character can match with '\' incorrectly.
And in eucJP encoding, there are the characters whose codepoints are
0xa5b9, 0xa5c8. On the other hand, there is one character whose
codepoint is 0xb9a5. So 0xb9a5 can match with 2nd byte of 0xa5b9
and 1st byte of 0xa5c8.
(EGexecute) : call check_multibyte_string when kwset is set.
(Fexecute) : call to check_multibyte_string.
(MB_CUR_MAX) : new macro.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* djgpp/config.bat : Fix for 4dos.com.
* m4/dosfile.m4 (HAVE_DOS_FILE_CONTENTS) : Was not set.
Bugs noted and patched by Juan Manuel Guerrero.
A much requested feature, the possibility to select
files when doing recurse :
# find . -name "*.c" | xargs grep main {}
# grep --include=*.c main .
# find . -not -name "*.c" | xargs grep main {}
# grep --exclude=*.c main .
* src/grep.c (short_options): -R equivalent to -r.
(#ifdef) : Fix some inconsistencies in the use of #ifdefs, prefer
#if defined() wen possible.
(long_options) : Add --color, --include and exclude.
(Usage) : Description of new options.
(color) : Rename color variable to color_option.
Removed 'always|never|auto' arguments, not necessary for grep.
(exclude_pattern) : new variable, holder for the file pattern.
(include_pattern) : new variable, hoder for the file pattern.
* src/savedir.c : Signature change, take two new argmuments.
* doc/grep.texi : Document, new options.
* doc/grep.man : Document, new options.
|
| |
|
|
|
|
| |
* doc/grep.texi : Typo fixes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Port to Mingw32, based on suggestions from Christian Groessler
<cpg@aladdin.de>.
* src/isdir.c: New file, taken from fileutils.
* src/Makefile.am (base_sources): Add isdir.c.
* src/grep.c (grepfile): Use isdir instead of doing it inline.
(grepdir): Suppress ancestor check if the directory's inode and device
are both zero, as that occurs only on Mingw32 which doesn't support
inode or device.
* src/system.h (isdir): New decl.
(is_EISDIR): Depend on HAVE_DIR_EACCES_BUG, not D_OK.
Use isdir, not access.
Problen noted by Gerald Stoller <gerald_stoller@hotmail.com>
* src/grep.c (main): POSIX.2 says that -q overrides -l, which
in turn overrides the other output options. Fix grep to
behave that way.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do CRLF munging only if HAVE_DOS_FILE_CONTENTS, instead of
having it depend on O_BINARY (which leads to incorrect results
on BeOS, VMS, and MacOS).
* bootstrap/Makefile.try (DEFS): Add -DHAVE_DOS_FILE_CONTENTS.
* src/system.h (SET_BINARY): Define only if HAVE_DOS_FILE_CONTENTS.
(O_BINARY): Do not define.
* m4/dosfile.m4: Define HAVE_DOS_FILE_CONTENTS if it appears we're
using DOS.
* src/grep.c (undossify_input, fillbuf, dosbuf.c, prline, main):
Depend on HAVE_DOS_FILE_CONTENTS, not O_BINARY, when handling CRLF
matters.
(grepfile, main): Depend on SET_BINARY, not O_BINARY, when
handling binary files on hosts that care about text versus binary.
* lib/getpagesize.h (getpagesize): Define to B_PAGE_SIZE if
__BEOS__ is defined. Based on a fix by Bruno Haible
<haible@clisp.cons.org>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
doc/grep.1 doc/grep.texi
support for -P(--pcre) Perl Compatible Regular Expression.
support for -m --max-count.
* configure.in: added AC_CHECK_LIB(pcre, pcre_exec)
* ChangeLog: Typos corrected.
* src/search.c: new MACRO HAVE_LIBPCRE
* src/Makefile.am(bin_PROGRAMS): added pgrep and new macro
pgrep_SOURCES.
* src/search.c: new functions Pcompile() and Pexecute()
to support PCRE. Update matcher[] array for pgrep.
* src/grep.c: new short and long option --pcre and -P.
usage() updated.
Improvement of the -m or --max-count option. Now works for NUM > 1 and
prints trailing context for the last matching line.
* src/grep.c
(after_last_match): Is a new off_t variable that replaces inputhwm
to retain the correct input offset even after a call to fillbuf. Note
that after_last_match has a different meaning than inputhwm:
it always points to the offset in the input of the first byte after
the last matching line, and is 0 if no matching line has been found
yet.
(grep): Print trailing context after the NUMth match when the -m NUM
option is used.
(grep): Added comment. Should have been commented already.
(grepbuf): Now updates outleft correctly. This fixes the bug that the
-m NUM option did not stop after NUM lines for NUM greater than 1.
(grepbuf, prtext): Now update after_last_match instead of inputhwm.
(fillbuf): No longer updates inputhwm.
(prpending): When outputting trailing context of the max_count-th
(grepfile): Seek to after_last_match or eof, depending on the values
(usage): added the -m or --max-count option to the help message.
* doc/grep.texi, doc/grep.1: Document the change of the -m option.
Add new -m or --max-count option, based on a suggestion by
Bastiaan Stougie.
* doc/grep.texi, doc/grep.1: Document it.
* src/grep.c (short_options, long_options, main): Add it.
(inputhwm): New variable.
(fillbuf, prtext, grepbuf): Set it.
(bufmapped): Now a macro (defined to zero) if HAVE_MMAP is not defined.
(max_count, outleft): New variables.
(prtext, grepbuf, grep): Don't output more than outleft lines.
(grepfile): If grepping standard input, seek to the limit of what
we've read before exiting. This fixes a bug with mmapped input,
and is needed for proper -m support.
(main): Exit immediately if -m 0 is specified.
|
|
|
|
| |
Martin added
|
|
|
|
|
|
|
|
|
|
|
| |
nit by Akim.
* src/grep.c (usage): The example "%s -i 'hello.*world' could
lead to confusion when progname is 'fgrep.
Noted by Akim Demaille.
* configure.in : Reenable, jm_INCLUDE_REGEX() since we now
track GNU lib C.
Requested By Ulrich Drepper.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
src/dosbuf.c src/getopt.c src/getopt.h src/getopt1.c
src/getpagesize.h src/grep.c src/kwset.c src/memchr.c
src/obstack.c src/obstack.h src/regex.c src/regex.h
src/savedir.c src/savedir.h src/search.c src/stpcpy.c
src/vms_fab.c
Changes by P. E. to convert to ANSI C
* Rectification the initial patch to add --binary-file option
was done by Ruslan Ermilov.
Sync with sources of fileutils 4.0n, tar 1.13.17, glibc 2.1.3a1.
Convert to ANSI C prototypes (using ansi2knr for backwards
compatibility), as this makes it easier to sync.
* configure.in (AC_OBJEXT): Spell in a funny way, to work around
a bug in automake 1.4 with ansi2knr.
(LIBOBJS): Add assignment so that .o files in LIBOBJS are also built
via the ANSI2KNR-filtering rules.
(AC_OUTPUT): Add src/posix/Makefile.
* src/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
(SUBDIRS): New macro.
* src/ansi2knr.1, src/ansi2knr.c, src/posix/Makefile.am: New files.
* src/dfa.c, src/dosbuf.c, src/grep.c, src/kwset.c, src/search.c,
src/vms_fab.c:
Use prototypes for function definitions.
* src/grep.c (main): Use int counter for default context,
fixing an ANSI portability bug uncovered by the above changes.
* config.guess, config.sub, install-sh, missing, src/alloca.c,
src/getpagesize.h, src/memchr.c, src/savedir.c, src/savedir.h,
src/stpcpy.c:
Upgrade to latest version from fileutils 4.0n.
* src/getopt.c, src/getopt.h, src/getopt1.c: Upgrade to latest
version from tar 1.13.17.
* src/obstack.c, src/obstack.h, src/regex.c, src/regex.h:
Upgrade to glibc 2.1.3 alpha 1, with K&R C portability fix.
* src/posix/regex.h: New file, from glibc 2.1.3 alpha 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
src/system.h
Support for general option --binary-file from David O'Brien.
Inititial patch from David O'Brien.
Add --binary-files option.
* NEWS, doc/grep.1, doc/grep.texi: Document it.
* src/grep.c (BINARY_FILES_OPTION): New constant.
(long_options, grep, usage, main): New --binary-files option.
(binary_files): New var.
* src/system.h (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, CHAR_MAX):
New macros.
(INT_MAX, UCHAR_MAX): Define in terms of TYPE_MAXIMUM.
|
|
|
|
| |
address change
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
new set o patches from Paul
new set o patches from Paul
* NEWS, doc/grep.1, doc/grep.texi: New option --mmap.
* src/grep.c (mmap_option): New variable.
(long_options, reset, usage): Add --mmap.
Default is now read, not mmap.
* doc/grep.1: Document -Z or --null.
* doc/grep.texi: Fix texinfo glitches. POSIX -> POSIX.2 where
appropriate.
* doc/grep.texi: Fix texinfo glitches. POSIX -> POSIX.2 where
appropriate.
* acconfig.h (ssize_t): New #undef.
* configure.in (AC_CHECK_TYPE): Add ssize_t.
* src/grep.c (PREFERRED_SAVE_FACTOR): New macro.
(reset): If the buffer has already been allocated, set bufsalloc to
be bufalloc / PREFERRED_SAVE_FACTOR. This avoids problems when
bufsalloc == bufalloc (possible after reading a large binary file).
(reset): Use PREFERRED_SAVE_FACTOR instead of magic constant.
Do not set bufbeg; nobody uses it.
Always set buflim.
Check for lseek error.
Use SEEK_CUR, not a magic constant.
(fillbuf): Return an error indication, not a count.
All callers changed.
Do not assume ssize_t fits in int.
Use PREFERRED_SAVE_FACTOR instead of magic constant.
Clean up mmap code.
Do not attempt to mmap zero bytes.
Check for lseek error.
Use SEEK_SET, not a magic constant.
Work correctly if read is interrupted.
(grepfile): Work correctly if open or close is interrupted.
* src/system.h (SEEK_SET, SEEK_CUR): New macros.
|
|
|
|
| |
new scheme by Paul Eggert for buffer allocation.
|