| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
minimal executable programs for legacy applications, instead of
shell scripts. This "fgrep" is much smaller than "grep".
This set of changes appears more daunting than it really is.
* src/egrep.c, src/fgrep.c, src/esearch.c, src/fsearch.c: New files
that #define either EGREP_PROGRAM or FGREP_PROGRAM and #include
the corresponding generic (i.e., non e or f specific) *.c file.
* src/grepmat.c: Remove whole file.
* src/Makefile.am: Remove no-dependencies from AUTOMAKE_OPTIONS.
Add definitions to make "egrep" and "fgrep" specific standalone
executable programs that only use the source files they need.
Remove rules for "egrep" and "fgrep" shell scripts.
* src/grep.h: #define GREP_PROGRAM if both EGREP_PROGRAM and
FGREP_PROGRAM are #undef. Only declare matchers[] in this case
along with the compile_fp_t and execute_fp_t function pointers
typedefs, otherwise declare prototypes for straight compile()
and execute() functions for the specialized "egrep" and "fgrep"
programs. Remove the extern declaration for matcher.
Define COMPILE_RET, COMPILE_ARGS, EXECUTE_RET, EXECUTE_ARGS,
COMPILE_FCT, and EXECUTE_FCT helper preprocessor macros.
* src/grep.c (short_options, long_options, usage, main): Only
support -G, -E, -F, -P, and -X for GREP_PROGRAM, but not for
EGREP_PROGRAM or FGREP_PROGRAM. Customize usage messages.
* src/grep.c (set_limits): New function with unchanged code,
called from main(), because it shouldn't be in install_matcher()
since it was already matcher-independent.
* src/grep.c (matcher): Add as static, only for GREP_PROGRAM.
* src/grep.c (setmatcher, install_matcher): Only for GREP_PROGRAM.
* src/grep.c (main): Remove any tweaking and dependence on argv[0].
* src/grep.c (print_line_middle, prpending, grepbuf, main): Call
compile() and execute() directly, not through a function
pointer dereferencing notation, so that it works with both
straight functions (in EGREP_PROGRAM and FGREP_PROGRAM) and
function pointers (in GREP_PROGRAM).
* src/search.c (<regex.h>, "dfa.h", dfa, pattern0, patterns,
pcount, dfaerror, kwset_exact_matches, kwsmusts): Only
include/declare/define if not FGREP_PROGRAM.
* src/search.c: Remove function prototypes for all functions
that are not used before their definition, since this is just
a hassle now with their varying names and conditional definition.
* src/search.c (GEAcompile): Rename from Ecompile(). Add new
syntax_bits argument/variable. Use as compile() for EGREP_PROGRAM.
Put in the needed RE_ICASE fix, albeit commented-out for now.
Make sure to free() modified word/line pattern after use, if any.
* src/search.c (Gcompile): Merge with GEAcompile() then remove.
* src/search.c (Gcompile, Acompile, Ecompile): New small functions
that call GEAcompile(), now that matcher is not an extern variable.
* src/search.c (GEAcompile, Gcompile, Acompile, Ecompile,
Fcompile, Pcompile, EGexecute, Fexecute, Pexecute, matchers):
Only define when needed according to *GREP_PROGRAM, and rename
to just compile() and execute() when appropriate.
* grep/bootstrap/Makefile.try: Similar changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
typos.
Chnages from Andreas.
* tests/*.awk : Linux users are seeing "Broken Pipe" on make check.
The problem is that grep does not drain its stdin, thus the previous
process in the pipeline receives a SIGPIPE. Other shells are silent
about this. There is actually no failure, since the broken pipe is
expected. You can work around it by changing the pipeline, so that
the input is drained, like this:
status=`echo 'check' | { ${GREP} -E -e pattern >/dev/null 2>&1;
echo $?; cat >/dev/null; }`; if test $status -ne $errnu then ... fi
Excerpt from email exchange with Andreas Schwab.
|
|
|
|
|
|
|
|
|
| |
Exclude btow.c.
remove.
* NEWS: Fix typo when talking about the old behavior of
silently skipping directories; it was grep 2.1, not grep 2.2.
|
|
|
|
|
|
|
| |
Add flags for djgpp.
* bootstrap/Makefile.try : add DJGPP DEFS.
Done by Elie Zaretsckii.
|
|
|
|
|
|
|
|
|
|
| |
update.
* grep-2.2f beta release.
* m4/{djgpp,envsep,glibc,regex,dosfile,isc-posix}.m4 :
New files to aid configuration and unload configure.in.
* m4/Makefile.am : updated.
Patch forwarded by Ben Elliston.
|
|
provided for system lacking configure.
update
added guard for HAVE_CONFIG_H
* grep-2.2f beta release.
* m4/{djgpp,envsep,glibc,regex,dosfile,isc-posix}.m4 :
New files to aid configuration and unload configure.in.
* m4/Makefile.am : updated.
Patch forwarded by Ben Elliston.
|