summaryrefslogtreecommitdiff
path: root/bootstrap.conf
Commit message (Collapse)AuthorAgeFilesLines
* maint: update all copyright year number rangesJim Meyering2020-01-011-1/+1
| | | | | | | | 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.
* grep: parse --color arg independent of localePaul Eggert2019-02-031-0/+1
| | | | | | | This is a better fix for Bug#34285. * bootstrap.conf (gnulib_modules): Add c-strcase. * src/grep.c: Include c-strcase.h, not strings.h. (main): Use c_strcasecmp, not strcasecmp.
* maint: update all copyright dates via "make update-copyright"Jim Meyering2019-01-011-1/+1
| | | | * gnulib: Also update submodule for its copyright updates.
* maint: fix build failurePaul Eggert2018-09-191-0/+1
| | | | | | | | | Problem found by OpenCSW buildbot; the bug also occurs on GNU/Linux build platforms. The symptom is “system.h:26:24: fatal error: configmake.h: No such file or directory”. See: https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-sparc/builds/107 * bootstrap.conf: Add configmake, a dependency that was formerly brought in only by accident.
* 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-061-1/+1
| | | | | | * gnulib: Update to latest. * all files: Run "make update-copyright". * bootstrap: Update from gnulib.
* grep: diagnose stack overflow rather than segfaultingJim Meyering2017-12-161-0/+1
| | | | | | | | | | | | | | | | | | | * bootstrap.conf (gnulib_modules): Add c-stack. * src/grep.c: Include "c-stack.h". (main): Call c_stack_action (NULL); * tests/stack-overflow: New file. * tests/Makefile.am (TESTS): Add name of new file. * NEWS (Improvements): Mention it. Interestingly, this bug does not afflict grep-2.5.4 or prior, so it appeared to have been introduced with grep-2.6. However, the origin is in glibc's regexp compiler, and I tracked it to stack-aware parsing that was removed from glibc's regexp in 2002. However, grep-2.5.4 was released in 2009. That version worked (and still works, now) because it included and (by default) used an old copy of glibc's regexp code. Jeremy Feusi reported the grep segfault in https://bugs.gnu.org/29666. I reported the glibc regexp bug in https://sourceware.org/bugzilla/show_bug.cgi?id=22620
* grep: fix directory recursion on MS-WindowsStephan T. Lavavej2017-11-261-0/+1
| | | | | | | | | | | | | | | | | gnulib recently gained a module, windows-stat-inodes, that fixes directory recursion on MS-Windows. No changes to grep's C sources are required; grep simply needs to request the module during configuration. When grep requests this module, its configure script will gain the behavior that was implemented in windows-stat-inodes.m4. This detects mingw and sets WINDOWS_STAT_INODES=1. All other platforms are unaffected, setting WINDOWS_STAT_INODES=0 (which is what's happening in the absence of this patch). * bootstrap.conf (gnulib_modules): Add windows-stat-inodes. * NEWS (Bug fixes): Mention it. Thanks to Pär Björklund who diagnosed the problem as involving inodes, and thanks to Václav Haisman who provided the bootstrap.conf patch.
* Fix up recent -U patchesPaul Eggert2017-02-161-4/+3
| | | | | | | | | | | | | | | Inspired by a suggestion by Eric Blake (Bug#25707#17). * bootstrap.conf (gnulib_modules): Add xbinary-io, and remove binary-io and xfreopen. * doc/grep.texi (Other Options): Fix typo and reword to be a bit more general. * src/grep.c: Include xbinary-io.h instead of xfreopen.h. (grepfile): Open with O_BINARY if binary. (grepdesc): No need for set_binary_mode now. (grep_command_line_arg, main): Set stdin to binary mode if binary. (main): Avoid unnecessary test of stdin == NULL. Use xsetmode instead of xfreopen. * src/system.h: Do not include binary-io.h.
* Simplify -U on MS-Windows by removing guessworkPaul Eggert2017-02-161-0/+1
| | | | | | | | | | | | | | Suggested by Eric Blake (Bug#25707#11). * NEWS, doc/grep.texi: Document this. * src/dosbuf.c: Remove. * bootstrap.conf (gnulib_modules): Add xfreopen. * src/grep.c: Include xfreopen.h, not dosbuf.c. (fillbuf, print_line_head): Do not undossify input. (binary): New static var. (grepdesc): Apply BINARY to input file. (usage): Remove -u help. (main): Set BINARY if -U, and apply it to stdout. Do nothing if -u. With -f, apply BINARY to input file.
* maint: update gnulib and copyright dates for 2017Jim Meyering2017-01-011-1/+1
| | | | | * gnulib: Update to latest. * all files: Run "make update-copyright".
* build: placate GCC 7's -Wimplicit-fallthroughJim Meyering2016-09-281-0/+1
| | | | | | | | | * src/pcresearch.c (die): New macro. (Pexecute): Use it in place of offending uses of error, to placate GCC 7's -Wimplicit-fallthrough. Include verify.h. Since this is grep's first explicit use of this gnulib module, ... * bootstrap.conf (gnulib_modules): Add verify.
* dfa: reflect move of grep's DFA code to gnulibJim Meyering2016-09-101-0/+1
| | | | | | | | | | | | | | | | | | | | | Now that the core DFA code and tests reside in gnulib, remove the copies here and use what gnulib provides. * bootstrap.conf: Use the dfa module. * cfg.mk: Remove settings involving files that have moved. (_gl_TS_unmarked_extern_functions): Add dfaerror and dfawarn. It is wrong/ugly to have to define these global symbols to use the dfa module, but we'll adjust that separately. * po/POTFILES.in: Apply s/src/lib/ to src/dfa.c. * src/Makefile.am: Remove mention of dfa.[ch] and localeinfo.[ch]. * tests/Makefile.am: Remove mention of the tests that we have moved to the gnulib module. * src/dfa.c: Remove file. * src/dfa.h: Likewise. * src/localeinfo.c: Likewise. * src/localeinfo.h: Likewise. * tests/dfa-match: Likewise. * tests/dfa-match-aux.c: Likewise. * tests/invalid-char-class: Likewise.
* maint: switch from gnulib's progname to getprogname moduleJim Meyering2016-09-051-1/+1
| | | | | | | | | | | * gnulib: Update to latest, for its new getprogname module. * bootstrap.conf (avoided_gnulib_modules): Include the getprogname module rather than the now-obsolescent progname. * src/grep.c: Include "getprogname.h" rather than "progname.h" and remove any use of set_program_name. * tests/dfa-match-aux.c (main): Likewise. * tests/get-mb-cur-max.c (main): Likewise. * src/grep.c (usage, main): Use getprogname() in place of program_name.
* dfa: remove dependency on btowcPaul Eggert2016-04-191-1/+0
| | | | | | | | | | | | | | | | | | | MirOS BSD btowc is a macro that (when GCC is being used) hardcodes btowc (0x80) == WEOF regardless of locale, which contradicts future POSIX in the C locale. Instead of bothering to develop a Gnulib workaround for the btowc incompatibility, use mbrtowc, which we are using elsewhere and fixing anyway, and are caching so it is fast here. Problem reported by Nelson H. F. Beebe via Jim Meyering in: http://bugs.gnu.org/23269#14 * bootstrap.conf (gnulib_modules): Remove btowc. * src/dfa.c (struct dfa): Remove mbrtowc_cache member, replacing with ... (mbrtowc_cache): ... this new static var. All uses changed. (dfambcache): Remove; now done by setsyntax. Call removed. (is_valid_unibyte_character): Remove. (IS_WORD_CONSTITUENT): Remove this macro, replacing it with ... (unibyte_word_constituent): ... this new function. It uses mbrtowc_cache rather than btowc. (dfasyntax): Initialize mbrtowc_cache before using it.
* tests: omit update-copyright-testsPaul Eggert2016-01-151-0/+1
| | | | | | | This test does not check how 'grep' itself operates, so it is out of place for grep's 'make check'. Problem reported by Sam Razavi in: http://bugs.gnu.org/22376 * bootstrap.conf (avoided_gnulib_modules): Add update-copyright-tests.
* maint: update copyright year, bootstrap, init.shJim Meyering2016-01-011-1/+1
| | | | | | | | Run "make update-copyright" and then... * gnulib: Update to latest. * tests/init.sh: Update from gnulib. * bootstrap: Likewise.
* build: avoid spurious bootstrap failure involving pkg.m4Jim Meyering2015-10-171-1/+3
| | | | | | | | | | Running ./bootstrap could fail mistakenly at the very end in its attempt to obtain a copy of pkg.m4. It would search only $(aclocal --print-ac-dir) and some other directories, but not those listed in $(aclocal --print-ac-dir)/dirlist. * bootstrap.conf (bootstrap_post_import_hook): Also search the directories named in $(aclocal --print-ac-dir)/dirlist when that file exists with nonzero size.
* build: use pkg-config (if available) to configure libpcrePaul Eggert2015-04-061-0/+15
| | | | | | | | | | | | | Problem reported by Mike Frysinger in: http://bugs.gnu.org/16757 * bootstrap.conf (bootstrap_post_import_hook): Copy pkg-config's pkg.m4. * configure.ac: Invoke PKG_PROG_PKG_CONFIG. * m4/pcre.m4 (gl_FUNC_PCRE): Rewrite to use pkg-config if available, and to test that pcre_compile can be linked to. * src/Makefile.am (AM_CFLAGS): Add PCRE_CFLAGS. (grep_LDADD): Add PCRE_LIBS. * src/pcresearch.c: Simply include <pcre.h> if HAVE_LIBPCRE, since 'configure' arranges for the appropriate -I option now.
* maint: update copyright year ranges to include 2015Jim Meyering2015-01-011-1/+1
| | | | | Run "make update-copyright". Also, ... * grep.texi: Update manually, converting each "--" to "-".
* grep: improve performance for older glibcPaul Eggert2014-09-161-0/+1
| | | | | | | | | glibc has a bug where mbrlen and mbrtowc mishandle length-0 inputs. Working around it in gnulib slows grep down, so disable the tests for it and make sure grep works even if the bug is present. * bootstrap.conf (avoided_gnulib_modules): Add mbrtowc-tests. * configure.ac (gl_cv_func_mbrtowc_empty_input): Assume yes. * src/searchutils.c (mb_next_wc): Don't invoke mbrtowc on empty input.
* doc: use gnulib fdl modulePaul Eggert2014-06-071-0/+1
| | | | | | * bootstrap.conf (gnulib_modules): Add fdl. * doc/fdl.texi: Remove, as this now comes from gnulib. * doc/.gitignore: Update to match current sources.
* grep: use system strstr if available and fastPaul Eggert2014-06-051-0/+1
| | | | | | | | | Problem reported by Norihiro Tanaka in: http://bugs.gnu.org/17700 * NEWS: Document this. * bootstrap.conf (gnulib_modules): Add strstr. * src/dfa.c (istrstr): Remove. (enlist): Use strstr instead. Wait until we need memory before allocating it; this can save an unnecessary allocate and free.
* kwset: speed up by using memchr2Paul Eggert2014-04-261-0/+1
| | | | | | | | | | | | | | Idea suggested by Eric Blake in: http://bugs.gnu.org/17229#43 * bootstrap.conf (gnulib_modules): Add memchr2. * src/kwset.c: Include stdint.h, for uintptr_t. Include memchr2.h. (struct kwset): New members gc1, gc2, gc1help. (tr): Move earlier, so it can be used earlier. (kwsprep): Initialize struct kwset's new members. (memchr_kwset): Rename from memchr_trans. Combine C and TRANS args into new arg KWSET. All uses changed. Use memchr2 when appropriate. (bmexec): Use new members instead of recomputing their values. Increase advance_heuristic; it's just a guess, but memchr2 probably makes it reasonable to increase it.
* grep: remove trival_case_ignorePaul Eggert2014-04-071-1/+0
| | | | | | | | | | | | | | | | | | This optimization is no longer needed, given the other optimizations recently installed. Derived from a patch by Norihiro Tanaka; see <http://bugs.gnu.org/17019>. * bootstrap.conf (gnulib_modules): Remove assert-h. * src/dfa.c (CASE_FOLDED_BUFSIZE): Move here from dfa.h. Remove now-unnecessary static assert. (case_folded_counterparts): Now static. * src/dfa.h (CASE_FOLDED_BUFSIZE, case_folded_counterparts): Remove decls; no longer public. * src/dfasearch.c (kwsmusts): Use kwset even if fill MB_CUR_MAX > 1 and case-insensitive. * src/grep.c (MBRTOWC, WCRTOMB): Remove. (fgrep_to_grep_pattern): Use mbrtowc, not MBRTOWC. (trivial_case_ignore): Remove; this optimization is no longer needed. All uses removed.
* build: avoid OS X 10.8.5 build failure due to lack of static_assertJim Meyering2014-04-061-0/+1
| | | | | | | | | * bootstrap.conf (gnulib_modules): Add assert-h, to accommodate the new use of static_assert on systems lacking support for that construct. Without this change, compilation of dfa.c failed on OS X 10.8.5 with gcc-4.9.0 20140324. We should be using gnulib's assert-h module, regardless, for its nominal improved portability, since grep includes assert.h and uses assert.
* maint: update copyright dates for 2014Jim Meyering2014-01-011-1/+1
| | | | Do that by running "make update-copyright".
* grep: handle lines longer than INT_MAX on more systemsJim Meyering2013-12-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | When trying to exercize some long-line-handling code, I ran these commands: $ dd bs=1 seek=2G of=big < /dev/null; grep -l x big; echo $? grep: big: Invalid argument 2 grep should not have issued that diagnostic, and it should have exited with status 1, not 2. What happened? grep read the 2GiB of NULs, doubled its buffer size, copied the 2GiB into the new 4GiB buffer, and proceeded to call "read" with a byte-count argument of 2^32. On at least Darwin 12.5.0, that makes read fail with EINVAL. The solution is to use gnulib's safe_read wrapper. * src/main.c: Include "safe-read.h" (fillbuf): Use safe_read, rather than bare read. The latter cannot handle a read size of 2^32 on some systems. * bootstrap.conf (gnulib_modules): Add safe-read. * tests/long-line-vs-2GiB-read: New file. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it.
* maint: remove now-unused wcscoll moduleJim Meyering2013-10-211-1/+0
| | | | * bootstrap.conf (gnulib_modules): Remove wcscoll; no longer used.
* build: update gnulib-related codeJim Meyering2013-08-101-8/+14
| | | | | | | * gnulib: Update submodule to latest. * bootstrap: Update from gnulib. * gl/lib/regex_internal.h.diff: Update to reflect gnulib changes. * bootstrap.conf: Partial sync from coreutils.
* maint: update all copyright year number rangesJim Meyering2013-01-041-1/+1
| | | | Run "make update-copyright".
* tests: skip failing test on FS/system that lack SEEK_HOLE supportJim Meyering2012-08-021-0/+1
| | | | | | | | * tests/big-hole: Test for SEEK_HOLE support. If not available, skip this test. Hence, this test is now skipped on linux-3.5.0 with ext4 or tmpfs. The test runs (and passes) with at least btrfs, xfs, or ocfs2. * bootstrap.conf (gnulib_modules): Use the perl module.
* maint: remove stat-sizePaul Eggert2012-07-271-1/+0
| | | | | * bootstrap.conf (gnulib_modules): Remove stat-size. * src/main.c: Don't include stat-size.h; no longer needed.
* build: fix a subtly twisted "make distcheck" failureJim Meyering2012-06-051-0/+11
| | | | | | | | | | | | | | | | | | | | "make distcheck" would fail when, during a test build, an attempt to overwrite the deliberately-write-protected $(srcdir)/grep.pot file would fail. * bootstrap.conf (bootstrap_epilogue): Don't let the existence of a large sparse file in the build directory induce "make distcheck" failure. The existence of a large sparse test file named 8T-or-so would make po/Makefile.in.in's use of grep (to search for "GNU grep" as an indication that this is a GNU package) exit 2 without generating any output, which made the first xgettext use --package-name=grep, while that same search for "GNU grep" would succeed when run from a pristine from-tarball build, thus making the second xgettext invocation use --package-name='GNU grep'. That mismatch: -"Project-Id-Version: grep 2.12.18-1080\n" +"Project-Id-Version: GNU grep 2.12.18-1080\n" led to the attempt by Makefile.in.in's grep.pot-update rule to overwrite ../../grep.pot in the read-only po/ source directory.
* grep: sparse files are now considered binaryPaul Eggert2012-05-151-0/+1
| | | | | | | | | | | | | * NEWS: Document this. * doc/grep.texi (File and Directory Selection): Likewise. * bootstrap.conf (gnulib_modules): Add stat-size. * src/main.c: Include stat-size.h. (usable_st_size): New function, mostly stolen from coreutils. (fillbuf): Use it. (file_is_binary): New function, which looks for holes too. (grep): Use it. * tests/Makefile.am (TESTS): Add big-hole. * tests/big-hole: New file.
* dfa: do not use hard-localePaolo Bonzini2012-04-271-1/+0
| | | | | | | | * bootstrap.conf (gnulib_modules): Remove hard-locale. * src/dfa.c (hard_LC_COLLATE): Remove. (dfaparse): Do not initialize it. (parse_bracket_exp): Always go through system regex matcher to find single byte characters matching a range.
* tests: skip annoyingly long gnulib lock testsJim Meyering2012-04-231-0/+5
| | | | | * bootstrap.conf (avoided_gnulib_modules): Define. (gnulib_tool_option_extras): Use it.
* grep: -r no longer follows symlinks; use ftsPaul Eggert2012-03-141-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* grep: fix integer-overflow issues in main programPaul Eggert2012-03-011-1/+2
| | | | | | | | | | | | | | | | | | * NEWS: Document this. * bootstrap.conf (gnulib_modules): Add inttypes, xstrtoimax. Remove xstrtoumax. * src/main.c: Include <inttypes.h>, for INTMAX_MAX, PRIdMAX. (context_length_arg, prtext, grepbuf, grep, grepfile) (get_nondigit_option, main): Use intmax_t, not int, for line counts. (context_length_arg, main): Silently ceiling line counts to maximum value, since there's no practical difference between doing that and using infinite-precision arithmetic. (out_before, out_after, pending): Now intmax_t, not int. (max_count, outleft): Now intmax_t, not off_t. (prepend_args, prepend_default_options, main): Use size_t, not int, for sizes. (prepend_default_options): Check for int and size_t overflow.
* build: update bootstrap from gnulib and adaptJim Meyering2012-01-221-5/+3
| | | | | | | | | | | * 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.
* colorize: use isatty modulePaolo Bonzini2012-01-031-0/+1
| | | | | | | | | | * 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.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* build: use gnulib's iswctype wcscollJim Meyering2011-12-121-0/+2
| | | | | | | | | * bootstrap.conf (gnulib_modules): Add iswctype and wcscoll. * configure.ac: Remove explicit checks for those functions. * src/mbsupport.h (MBS_SUPPORT): Define to 1 if not already defined. Remove the conditional, now that we're guaranteed by gnulib to have wcscoll and iswctype. Suggested by Alan Hourihane in http://savannah.gnu.org/bugs/?34930
* build: use largefile module and update to latest gnulibJim Meyering2011-08-201-0/+1
| | | | | | * configure.ac: Remove AC_SYS_LARGEFILE, subsumed by ... * bootstrap.conf (gnulib_modules): ...this. Use largefile module. * gnulib: Update to latest.
* exit 2 (rather than infloop) when an input file is also on stdoutJim Meyering2011-07-241-1/+2
| | | | | | | | | | | | | | | | | This avoids a potential "infinite" disk-filling loop. Reported in http://savannah.gnu.org/patch/?5316 and http://savannah.gnu.org/bugs/?17457. * src/main.c: Include "quote.h". (out_stat): New global. (grepfile): Compare each regular file's dev/ino/etc. with those from the file on stdout (if it too is regular). (main): Set out_stat, if stdout is a regular file. * src/system.h: Include "same-inode.h". (same_file_attributes): Define. From diffutils. (SAME_REGULAR_FILE): Define. * bootstrap.conf (gnulib_modules): Use quote, not quotearg. Use same-inode. * NEWS (Bug fixes): Mention it.
* build: avoid configure/gnulib-related errorsJim Meyering2011-06-211-32/+0
| | | | | * bootstrap.conf: Remove now-unnecessary code to exclude gettext/intl-related m4 tests.
* gnulib: adjust included modulesPaolo Bonzini2011-06-071-2/+1
| | | | | * bootstrap.conf (gnulib_modules): Drop strtoul, rename wctype to wctype-h.
* maint: use gnulib's new readme-release moduleJim Meyering2011-05-071-0/+2
| | | | | | | | * bootstrap.conf (gnulib_modules): Add readme-release. (bootstrap_epilogue): Add the recommended perl one-liner. * README-release: Remove file; it is now generated from gnulib. * .gitignore: Add it. * gnulib: Update submodule to latest.
* maint: remove now-unnecessary use of gnulib's strtol moduleJim Meyering2011-05-011-1/+0
| | | | * bootstrap.conf (gnulib_modules): Remove now-obsolete "strtol".
* maint: update copyright year ranges to include 2011Jim Meyering2011-01-031-1/+1
| | | | Run "make update-copyright", so "make syntax-check" works in 2011.