From 5e20a38a99fe6f0380f810b602d665dec2ae7cd0 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 23 Jul 2011 22:52:06 +0200 Subject: 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. --- bootstrap.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bootstrap.conf') 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 -- cgit v1.2.1