summaryrefslogtreecommitdiff
path: root/.gitignore
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-03-10 11:29:32 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2012-03-14 22:28:27 -0700
commitc6e3ea61d9f08aa0128a0eb13d31a2fbad376f99 (patch)
tree657c6157dd4b4c250a4bbdf770ef62cfb2062571 /.gitignore
parent354516cd121a7cdbad1397662b718b04c349692a (diff)
downloadgrep-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 '.gitignore')
-rw-r--r--.gitignore2
1 files changed, 0 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 35f5d10b..0b195d96 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,5 +64,3 @@ TAGS
!/lib/colorize-posix.c
!/lib/colorize-w32.c
!/lib/colorize.h
-!/lib/savedir.c
-!/lib/savedir.h