diff options
author | Jim Meyering <meyering@redhat.com> | 2011-07-23 22:52:06 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2011-07-24 16:48:28 +0200 |
commit | 5e20a38a99fe6f0380f810b602d665dec2ae7cd0 (patch) | |
tree | 184b6b5d7aa4918b87a714e75900dc7cb7e3b8b0 /bootstrap.conf | |
parent | 708b04abffa269253b92b35686e7852b7639adb7 (diff) | |
download | grep-5e20a38a99fe6f0380f810b602d665dec2ae7cd0.tar.gz |
exit 2 (rather than infloop) when an input file is also on stdout
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.
Diffstat (limited to 'bootstrap.conf')
-rw-r--r-- | bootstrap.conf | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bootstrap.conf b/bootstrap.conf index 143d7b5c..66c239e2 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -57,10 +57,11 @@ obstack open progname propername -quotearg +quote readme-release realloc-gnu regex +same-inode ssize_t stddef stdlib |