summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* maint: update copyright datesJim Meyering2023-01-014-4/+4
|
* maint: make update-copyrightJim Meyering2022-01-014-4/+4
|
* maint: run "make update-copyright"Paul Eggert2021-01-014-4/+4
|
* maint: update all copyright year number rangesJim Meyering2020-01-014-4/+4
| | | | | | | | Run "make update-copyright" and then... * gnulib: Update to latest with copyright year adjusted. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Likewise. * doc/grep.in.1: Use "-" in copyright year ranges, not \en.
* maint: update all copyright dates via "make update-copyright"Jim Meyering2019-01-014-4/+4
| | | | * gnulib: Also update submodule for its copyright updates.
* maint: update URLsPaul Eggert2018-04-211-1/+1
| | | | | Mostly this is just changing http: to https:. In one or two places it removes no-longer-useful URLs.
* maint: update gnulib and copyright dates for 2018Jim Meyering2018-01-064-4/+4
| | | | | | * gnulib: Update to latest. * all files: Run "make update-copyright". * bootstrap: Update from gnulib.
* maint: update gnulib and copyright dates for 2017Jim Meyering2017-01-014-4/+4
| | | | | * gnulib: Update to latest. * all files: Run "make update-copyright".
* maint: update copyright year, bootstrap, init.shJim Meyering2016-01-014-4/+4
| | | | | | | | Run "make update-copyright" and then... * gnulib: Update to latest. * tests/init.sh: Update from gnulib. * bootstrap: Likewise.
* maint: update copyright year ranges to include 2015Jim Meyering2015-01-014-4/+4
| | | | | Run "make update-copyright". Also, ... * grep.texi: Update manually, converting each "--" to "-".
* build: don't make output files read-onlyPaul Eggert2014-06-171-2/+0
| | | | | | | | | | | | This led to problems, such as the prompt "mv: try to overwrite 'egrep', overriding mode 0555 (r-xr-xr-x)? " during a build. It can be worked around, but the cure is worse than the disease; making output files read-only is more trouble than it's worth. * doc/Makefile.am (grep.1, egrep.1, fgrep.1): * lib/Makefile.am (colorize.c): * src/Makefile.am (egrep fgrep): Don't make output files read-only. Prefer separate commands to '&&' when either will do.
* build: don't redirect directly to $@Jim Meyering2014-06-061-1/+4
| | | | | | | * lib/Makefile.am (colorize.c): Don't redirect directly to target, $@. Otherwise, we could create a corrupt colorize.c file with a timestamp that indicates it is up to date. Also, make the generated file read-only.
* dist: don't distribute lib/colorize.cPaul Eggert2014-05-241-3/+5
| | | | | | | | | | | 'configure' creates this file, so it shouldn't be distributed; see: http://bugs.gnu.org/17480 * configure.ac (COLORIZE_SOURCE): New macro. Don't use AC_CONFIG_LINKS for lib/colorize.c. * lib/Makefile.am (nodist_libgreputils_a_SOURCES): New macro. (libgreputils_a_SOURCES): Remove colorize.c. (CLEANFILES): Add colorize.c (colorize.c): New rule.
* maint: update copyright dates for 2014Jim Meyering2014-01-014-4/+4
| | | | Do that by running "make update-copyright".
* build: remove redundant use of $(INCLUDES)Stefano Lattarini2013-01-111-2/+0
| | | | | | | * lib/Makefile.am (INCLUDES): Remove. Automake automatically adds $(srcdir) and $(top_builddir) to the C preprocessor search path. INCLUDES is deprecated in Automake 1.13 (causing a runtime warning), and will be removed in Automake 1.14.
* maint: update all copyright year number rangesJim Meyering2013-01-044-4/+4
| | | | Run "make update-copyright".
* maint: quote 'like this' or "like this", not `like this'Paul Eggert2012-05-061-1/+1
| | | | | | | | | | | | | | | | See <http://lists.gnu.org/archive/html/bug-grep/2012-01/msg00125.html>. * ChangeLog-2009, HACKING, NEWS, README-hacking, cfg.mk, configure.ac: * lib/colorize-w32.c, m4/pcre.m4: * src/Makefile.am, src/dfa.c, src/dosbuf.c, src/main.c: * tests/backref, tests/help-version, tests/tests: In commentary, quote 'like this' or "like this" rather than `like this' or ``like this''. * cfg.mk (old_NEWS_hash): Update due to changed old NEWS. * doc/grep.texi (General Output Control): Quote sample text with @samp, not with `...'. * src/main.c (usage): * tests/help-version: Quote 'like this' rather than `like this' in diagnostics.
* grep: -r no longer follows symlinks; use ftsPaul Eggert2012-03-143-175/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* build: update bootstrap from gnulib and adaptJim Meyering2012-01-221-0/+11
| | | | | | | | | | | * bootstrap: Update from gnulib. * tests/init.sh: Update from gnulib. * bootstrap.conf (bootstrap_epilogue): Remove now-unnecessary, snippet that edited gnulib-tests/gnulib.mk. (gnulib_tool_option_extras): Add both --symlink and --makefile-name=gnulib.mk. Remove use of $bt. * lib/Makefile.am: Initialize numerous automake variables so that generated code in gnulib.mk may use += to append to them.
* build: avoid build failure with --enable-gcc-warnings and recent gccJim Meyering2012-01-031-0/+6
| | | | | * lib/colorize-posix.c: Disable -Wsuggest-attribute=const, to avoid warning about this empty init_colorize function.
* remove lib/ms/Paolo Bonzini2012-01-034-2/+1
| | | | | | | | | | * configure.ac: Create lib/colorize.c as a symbolic link. * lib/colorize-posix.c: New name of lib/colorize-impl.c. * lib/colorize-w32.c: New name of lib/ms/colorize-impl.c. * lib/colorize.c: Delete. * lib/Makefile.am (EXTRA_DIST): Adjust. * .gitignore: Adjust. * cfg.mk: Adjust syntax-check exclusions.
* unify colorize.h headersPaolo Bonzini2012-01-034-23/+22
| | | | | | | | * lib/Makefile.am (EXTRA_DIST): Adjust. * lib/colorize.h: Remove inline functions. * lib/colorize-impl.c: Move them here as functions. * lib/ms/colorize.h: Remove. * src/Makefile.am (DEFAULT_HEADERS): Remove.
* colorize: use isatty modulePaolo Bonzini2012-01-034-25/+12
| | | | | | | | | | * bootstrap.conf: Add isatty module. * gnulib: Update to latest. * lib/colorize.h: Remove argument from should_colorize. * lib/ms/colorize.h: Likewise. * lib/colorize-impl.c: Factor isatty call out of here... * lib/ms/colorize-impl.c: ... and here... * src/main.c: ... into here.
* grep: prefer fgets to printf, _ to gettextPaul Eggert2012-01-022-2/+2
| | | | | | | * lib/colorize.h (print_end_colorize): * lib/ms/colorize-impl.c (print_end_colorize): Use fputs instead of printf. * src/main.c (usage): Likewise. Use _ instead of gettext.
* maint: update all copyright year number rangesJim Meyering2012-01-015-5/+5
| | | | Run "make update-copyright".
* ms: move Microsoft-specific stuff to lib/msPaul Eggert2011-12-316-1/+300
| | | | | | | | | | | | | | | | | | | | | | | * cfg.mk (exclude_file_name_regexp--sc_prohibit_strcmp) (exclude_file_name_regexp--sc_require_config_h) (exclude_file_name_regexp--sc_require_config_h_first): New rules. * lib/colorize.c, lib/colorize.h, lib/colorize-impl.c: * lib/ms/colorize.h, lib/ms/colorize-impl.c: New files. * configure.ac (GREP_SRC_INCLUDES): New macro. * lib/Makefile.am (libgreputils_a_SOURCES): Add colorize.[ch]. (EXTRA_DIST): New macro. * src/Makefile.am (DEFAULT_INCLUDES): New macro. * src/main.c: Include colorize.h. (PR_SGR_START, PR_SGR_END, PR_SGR_START_IF, PR_SGR_END_IF): Now static functions, not macros. (hstdout, norm_attr, w32_console_init, w32_sgr2attr) (w32_clreol) [__MINGW32__]: Move to lib/ms/colorize-impl.c. (pr_sgr_start, pr_sgr_end): Remove; callers changed to use new print_start_colorize, print_end_colorize from colorize.h. (init_colorize): Rename from w32_console_init and move to colorize module; caller changed. (should_colorize): Move to colorize module.
* maint: remove unneeded #include directivesJim Meyering2011-01-261-1/+0
| | | | | * lib/savedir.c: Don't include <stddef.h>. Not needed. * src/dfa.c: Likewise.
* maint: update copyright year ranges to include 2011Jim Meyering2011-01-032-2/+2
| | | | Run "make update-copyright", so "make syntax-check" works in 2011.
* convert all TABs to equivalent spaces in indentationJim Meyering2010-04-082-47/+47
| | | | | | | | | | | | | | | | | | | Using this file, cat > leading-blank.exempt <<\EOF (?:^|\/)ChangeLog[^/]*$ (?:^|\/)(?:GNU)?[Mm]akefile[^/]*$ \.(?:am|mk)$ EOF run this command to convert all non-conforming leading white space to be all spaces: git ls-files \ | pcregrep -vf leading-blank.exempt \ | xargs pcregrep -l '^ *\t' \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
* build: avoid warnings on cygwinEric Blake2010-03-291-1/+1
| | | | | | * lib/savedir.c (isdir): Avoid shadowing a declaration. * src/main.c (get_nondigit_option): Cast away const to avoid compiler warning.
* grep -r: fix --include with non-globsJim Meyering2010-03-281-1/+1
| | | | | | | | * 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
* grep: don't segfault upon use of --include or --exclude* optionsJim Meyering2010-03-271-1/+1
| | | | | | | | * 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.
* maint: remove all uses of PARAMSJim Meyering2010-03-111-11/+3
| | | | | | | | | | | * lib/savedir.h (PARAMS): Remove definitions manually. Remove the remaining ones via this command: git grep -l define.PARAMS |xargs perl -ni -e '/define PARAMS/ or print' * src/dfa.h (PARAMS): Remove definitions. * src/system.h (PARAMS): Likewise. Remove most uses with this: git grep -lw PARAMS |xargs perl -pi -e 's/\bPARAMS *\((.*)\);/$1;/' Remove the remainder manually.
* eliminate invalid "ptr += (ptr2 - ptr1)"Paolo Bonzini2010-03-051-1/+1
| | | | | | | * lib/savedir.c (savedir): new_name_space and name_space do not point into the same object, so computing their difference is invalid. Similarly, summing the difference to namep is invalid because namep and the result point into different objects. Avoid this.
* fix for bug 21276Paolo Bonzini2010-03-051-14/+20
| | | | | | * lib/savedir.c (isdir1): Use realloc instead of calloc. Remove dead code. (savedir): Do not leak name_space if allocation of new_name_space fails.
* build: avoid warnings in gnulib-supplied regex filesJim Meyering2010-02-031-1/+1
| | | | | | | | | | | | | | | | Now that we enable more warnings in lib/, we choose to avoid some via patches applied by bootstrap, using files in the gl/ hierarchy. Other, less-important warnings are avoided simply by turning off the -Wold-style-definition option and using a slightly relaxed set of warnings $(GNULIB_WARN_CFLAGS) in lib/. * gl/lib/regcomp.c.diff: Avoid warnings. * gl/lib/regex_internal.c.diff: Likewise. * gl/lib/regex_internal.h.diff: Likewise. * gl/lib/regexec.c.diff: Likewise. * configure.ac (GNULIB_PORTCHECK): Disable only -Wold-style-definition. * lib/Makefile.am (AM_CFLAGS): Use $(GNULIB_WARN_CFLAGS) rather than the slightly more strict $(WARN_CFLAGS).
* maint: use regex from gnulib, rather than our bit-rotting oneJim Meyering2010-02-032-8476/+0
| | | | | | | | | | * bootstrap.conf (gnulib_modules): Add regex. * configure.ac: Don't use jm_INCLUDED_REGEX. Update use of cache variable. * lib/regex.c: Remove file. * lib/regex.h: Likewise. * m4/regex.m4: Likewise. * POTFILES.in: Update to match.
* build: add configure-time --enable-gcc-warnings option; avoid warningsJim Meyering2010-01-061-0/+2
| | | | | | | * bootstrap.conf (gnulib_modules): Add "manywarnings" module. * configure.ac: Add --enable-gcc-warnings, derived from code in bison. * src/Makefile.am (AM_CFLAGS): Set to $(WARN_CFLAGS) $(WERROR_CFLAGS) * lib/Makefile.am (AM_CFLAGS): Likewise, but append.
* maint: remove {m4,lib}/.gitignore; they were undergoing too much churnJim Meyering2010-01-061-186/+0
| | | | | | | * .gitignore: Ignore all of m4/* except m4/djgpp.m4 and all of lib/* except Makefile.am, savedir.c and savedir.h. * m4/.gitignore: Remove file. * lib/.gitignore: Remove file.
* maint: update all FSF copyright year lists to include 2010Jim Meyering2010-01-014-7/+5
| | | | | | Use this command: git ls-files |grep -vE '^(\..*|COPYING|gnulib)$' |xargs \ env UPDATE_COPYRIGHT_USE_INTERVALS=1 build-aux/update-copyright
* maint: enable prohibit_have_config_h checkJim Meyering2009-12-042-6/+2
| | | | | | | | | * cfg.mk (local-checks-to-skip): Enable sc_prohibit_have_config_h * lib/regex.c: Remove useless cpp test of HAVE_CONFIG_H. * lib/savedir.c: Likewise. * src/grep.c: Likewise. * src/kwset.c: Likewise. * src/search.c: Likewise.
* fix compilation with included regexPaolo Bonzini2009-12-041-0/+1
| | | | * Makefile.am (libgreputils_a_DEPENDENCIES): New.
* maint: enable makefile @...@ checkJim Meyering2009-11-301-1/+1
| | | | | | | | * cfg.mk (local-checks-to-skip): Enable sc_makefile_check. * lib/Makefile.am (libgreputils_a_LIBADD): Use $(...), rather than anachronistic @...@ notation. * src/Makefile.am (LDADD): Likewise. * tests/Makefile.am (AWK): Remove definition.
* maint: use gnulib's progname module; enable set_program_name checkJim Meyering2009-11-301-0/+2
| | | | | | | | * bootstrap.conf (gnulib_modules): Add progname. * src/grep.c: Include "progname.h". (program_name): Remove declaration. (main): Call set_program_name. * cfg.mk (local-checks-to-skip): Add sc_program_name.
* maint: enable "file system" checkJim Meyering2009-11-301-2/+2
| | | | | * cfg.mk (local-checks-to-skip): Enable sc_file_system. * lib/savedir.c (savedir): Tweak spelling. Remove trailing blanks.
* build: get more lib/* files from gnulib, adjust savedirJim Meyering2009-11-3011-504/+77
| | | | | | | | | | | | | | * bootstrap.conf (gnulib_modules): Add the following: closeout exclude hard-locale isdir strtoumax. * lib/.gitignore, m4/.gitignore: Update. * lib/closeout.c, lib/closeout.h: Remove. * lib/exclude.c, lib/exclude.h: Remove. * lib/hard-locale.c, lib/hard-locale.h: Remove. * lib/strtoumax.c: Remove. * lib/isdir.c: Remove. * lib/Makefile.am: Remove here, too. * lib/savedir.c: Adapt to new exclude module: s/excluded_filename/excluded_file_name/ and remove 3rd argument.
* maint: generate ChangeLog from git logsJim Meyering2009-11-301-0/+1
| | | | | | | | | * Makefile.am (dist-hook, gen-ChangeLog): New rules. * bootstrap.conf (gnulib_modules): Add gitlog-to-changelog. Ensure that ChangeLog exists. * ChangeLog-2009: Rename from ChangeLog * ChangeLog: Remove file. * .gitignore: Add ChangeLog.
* replace AC_DOSFILE with gnulib modulesPaolo Bonzini2009-11-261-0/+10
| | | | | | | | * bootstrap.conf: Add binary-io, dirname. * configure.ac: Remove check for setmode, AC_DOSFILE. * m4/dosfile.m4: Remove. * src/grep.c: Adjust for dirname.h. * src/system.h: Adjust for new gnulib modules.
* replace AC_CHECK_* with gnulib modulesPaolo Bonzini2009-11-264-65/+23
| | | | | | | | | | | | | | | | * bootstrap.conf: Add gnulib modules for replacement functions and headers. * configure.ac: Remove macros subsumed by gnulib. * lib/hard-locale.c: Remove guards for headers/functions provided by gnulib. * lib/regex.c: Likewise. * lib/savedir.c: Likewise. * src/dfa.c: Likewise. * src/dfa.h: Do not look at PROTOTYPES. * src/grep.c: Likewise. * src/mbsupport.h: Likewise. * src/system.h: Likewise. * m4/mbstate_t.m4: Remove. * src/getpagesize.h: Remove.
* add gnulib modulesPaolo Bonzini2009-11-2628-6186/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bootstrap.conf: Add gnulib modules and build libgreputils.a. * configure.ac: Remove macros subsumed by gnulib. * lib/Makefile.am: Remove files subsumed by gnulib. * lib/alloca.c: Remove. * lib/atexit.c: Remove. * lib/error.c: Remove. * lib/error.h: Remove. * lib/fnmatch.c: Remove. * lib/fnmatch.h: Remove. * lib/getopt.c: Remove. * lib/getopt.h: Remove. * lib/getopt1.c: Remove. * lib/gettext.h: Remove. * lib/malloc.c: Remove. * lib/memchr.c: Remove. * lib/obstack.c: Remove. * lib/obstack.h: Remove. * lib/quotearg.c: Remove. * lib/quotearg.h: Remove. * lib/realloc.c: Remove. * lib/stpcpy.c: Remove. * lib/strtol.c: Remove. * lib/strtoul.c: Remove. * lib/strtoull.c: Remove. * lib/xalloc.h: Remove. * lib/xmalloc.c: Remove. * lib/xstrtol.c: Remove. * lib/xstrtol.h: Remove. * lib/xstrtoumax.c: Remove. * m4/error.m4: Remove. * m4/inttypes_h.m4: Remove. * m4/malloc.m4: Remove. * m4/realloc.m4: Remove. * m4/uintmax_t.m4: Remove. * m4/ulonglong.m4: Remove. * m4/xstrtoumax.m4: Remove. * src/system.h: Remove strerror, sys_nerr, sys_errlist.