diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-03-10 11:29:32 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-03-14 22:28:27 -0700 |
commit | c6e3ea61d9f08aa0128a0eb13d31a2fbad376f99 (patch) | |
tree | 657c6157dd4b4c250a4bbdf770ef62cfb2062571 /po | |
parent | 354516cd121a7cdbad1397662b718b04c349692a (diff) | |
download | grep-c6e3ea61d9f08aa0128a0eb13d31a2fbad376f99.tar.gz |
grep: -r no longer follows symlinks; use fts
Change -r to follow only command-line symlinks, and by default to
read only devices named on the command line. This is a simple
way to get a more-useful behavior when searching random
directories; the idea is to use 'find' if you want something fancy.
-R acts as before and gets a new alias --dereference-recursive.
The code now uses fts internally, so it is more robust and
faster with large hierarchies.
* .gitignore: Remove lib/savedir.c, lib/savedir.h.
* tests/symlink: New file
* Makefile.boot (LIB_OBJS_core): Remove isdir.o, savedir.o.
Perhaps other changes are needed too, but I'm not sure what
this makefile is for.
* NEWS: Document changes.
* doc/grep.texi (File and Directory Selection): Likewise.
* bootstrap.conf (gnulib_modules): Remove dirent, dirname, isdir, open.
Add fstatat, fts, openat-safer.
* lib/Makefile.am (libgreputils_a_SOURCES): Remove savedir.c, savedir.h.
* lib/savedir.c, lib/savedir.h: Remove.
* po/POTFILES.in: Add lib/openat-die.c.
* src/main.c: Include fcntl-safer.h, fts_.h. Don't include
isdir.h, savedir.h.
(struct stats, stats_base): Remove.
(long_options, usage, main): Add --dereference-recursive and
implement -r vs -R.
(filename_prefix_len, fts_options): New static vars.
(basic_fts_options, READ_COMMAND_LINE_DEVICES): New constants.
(devices): Now defaults to READ_COMMAND_LINE_DEVICES.
(reset, grep): Now takes just struct stat rather than file name and
struct stats. All callers changed.
(fillbuf): Now takes struct stat reather than struct stats.
All callers changed.
(grep): Don't worry about recursing too deeply; fts and grepdesc
handle this now.
(is_device_mode, grepdirent, grepdesc, grep_command_line_args):
New functions.
(grepfile): New args DIRDESC, FOLLOW, COMMAND_LINE. Remove struct stats
arg. All callers changed. Use openat_safer rather than open.
Use desc == STDIN_FILENO to tell whether we're reading "-".
Don't worry about EINTR when closing -- not possible, since we're
not catching signals.
* tests/Makefile.am (TESTS): Add symlink.
* tests/symlink: New file.
Diffstat (limited to 'po')
-rw-r--r-- | po/POTFILES.in | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/po/POTFILES.in b/po/POTFILES.in index b33c1265..65f4f57b 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -20,6 +20,7 @@ lib/closeout.c lib/error.c lib/getopt.c lib/obstack.c +lib/openat-die.c lib/quotearg.c lib/regcomp.c lib/version-etc.c |