From MAILER-DAEMON Sun May 06 18:52:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SRAJd-0000n7-Pf
	for mharc-grep-commit@gnu.org; Sun, 06 May 2012 18:52:33 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38078)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SRAJY-0000mU-Rj
	for grep-commit@gnu.org; Sun, 06 May 2012 18:52:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SRAJW-0001u3-75
	for grep-commit@gnu.org; Sun, 06 May 2012 18:52:28 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:45011)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SRAJW-0001tv-2y
	for grep-commit@gnu.org; Sun, 06 May 2012 18:52:26 -0400
Received: from eggert by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <eggert@cs.ucla.edu>) id 1SRAJV-0000xQ-8q
	for grep-commit@gnu.org; Sun, 06 May 2012 22:52:25 +0000
Date: Sun, 06 May 2012 22:52:25 +0000
Message-Id: <E1SRAJV-0000xQ-8q@vcs.savannah.gnu.org>
To: grep-commit@gnu.org
Subject: grep branch, master, updated. v2.12-10-g58195fa
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: e5a5657e3c28c9ed26b6641cdc20c346962e3f97
X-Git-Newrev: 58195fabc7559541b3736400e08e901011acd61f
From: Paul Eggert <eggert@cs.ucla.edu>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.72
X-BeenThere: grep-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: bug-grep@gnu.org
List-Id: CVS commit notices for GNU grep <grep-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/grep-commit>,
	<mailto:grep-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/grep-commit>
List-Post: <mailto:grep-commit@gnu.org>
List-Help: <mailto:grep-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/grep-commit>,
	<mailto:grep-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 06 May 2012 22:52:32 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  58195fabc7559541b3736400e08e901011acd61f (commit)
       via  c1ac4ab87042fd0d18d6bda9db75677c7913341f (commit)
      from  e5a5657e3c28c9ed26b6641cdc20c346962e3f97 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=58195fabc7559541b3736400e08e901011acd61f


commit 58195fabc7559541b3736400e08e901011acd61f
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Sun May 6 15:50:58 2012 -0700

    exclude: process exclude and include directives in order
    
    Also, change exclude and include directives so that they apply to
    command-line arguments too.  This restores the pre-2.6 behavior,
    and fixes a bug reported by Quentin Arce in
    <http://lists.gnu.org/archive/html/bug-grep/2012-04/msg00056.html>.
    * NEWS: Document this.
    * src/main.c (included_patterns): Remove.  All uses removed.
    (skipped_file): New function.
    (grepdirent): New arg command_line; all callers changed.  This is
    needed because non-command-line files can invoke fts_open, and
    their directory entries need to be distinguished from top-level
    directory entries.  Move code into the new skipped_file function.
    (grepdesc): Check whether a command-line argument should be skipped.
    (main): --include and --exclude options now share excluded_patterns
    rather than having separate variables included_patterns and
    excluded_patterns.
    * tests/include-exclude: Add a test to detect the fixed bug.

diff --git a/NEWS b/NEWS
index eb77919..9bd7e67 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,13 @@ GNU grep NEWS                                    -*- outline -*-
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+** Bug fixes
+
+  --include and --exclude can again be combined, and again apply to
+  the command line, e.g., "grep --include='*.[ch]' --exclude='system.h'
+  PATTERN *" again reads all *.c and *.h files except for system.h.
+  [bug introduced in grep-2.6]
+
 ** Dropped features
 
   Bootstrapping with Makefile.boot has been broken since grep 2.6,
diff --git a/src/main.c b/src/main.c
index cb6da2c..b91a042 100644
--- a/src/main.c
+++ b/src/main.c
@@ -272,7 +272,6 @@ static const struct color_cap color_dict[] =
   };
 
 static struct exclude *excluded_patterns;
-static struct exclude *included_patterns;
 static struct exclude *excluded_directory_patterns;
 /* Short options.  */
 static char const short_options[] =
@@ -449,6 +448,20 @@ context_length_arg (char const *str, intmax_t *out)
     }
 }
 
+/* Return nonzero if the file with NAME should be skipped.
+   If COMMAND_LINE is nonzero, it is a command-line argument.
+   If IS_DIR is nonzero, it is a directory.  */
+static int
+skipped_file (char const *name, int command_line, int is_dir)
+{
+  return (is_dir
+          ? (directories == SKIP_DIRECTORIES
+             || (! (command_line && filename_prefix_len != 0)
+                 && excluded_directory_patterns
+                 && excluded_file_name (excluded_directory_patterns, name)))
+          : (excluded_patterns
+             && excluded_file_name (excluded_patterns, name)));
+}
 
 /* Hairy buffering mechanism for grep.  The intent is to keep
    all reads aligned on a page boundary and multiples of the
@@ -1207,11 +1220,11 @@ grep (int fd, struct stat const *st)
 }
 
 static int
-grepdirent (FTS *fts, FTSENT *ent)
+grepdirent (FTS *fts, FTSENT *ent, int command_line)
 {
   int follow, dirdesc;
-  int command_line = ent->fts_level == FTS_ROOTLEVEL;
   struct stat *st = ent->fts_statp;
+  command_line &= ent->fts_level == FTS_ROOTLEVEL;
 
   if (ent->fts_info == FTS_DP)
     {
@@ -1220,17 +1233,9 @@ grepdirent (FTS *fts, FTSENT *ent)
       return 1;
     }
 
-  if ((ent->fts_info == FTS_D || ent->fts_info == FTS_DC
-       || ent->fts_info == FTS_DNR)
-      ? (directories == SKIP_DIRECTORIES
-         || (! (command_line && filename_prefix_len != 0)
-             && excluded_directory_patterns
-             && excluded_file_name (excluded_directory_patterns,
-                                    ent->fts_name)))
-      : ((included_patterns
-          && excluded_file_name (included_patterns, ent->fts_name))
-         || (excluded_patterns
-             && excluded_file_name (excluded_patterns, ent->fts_name))))
+  if (skipped_file (ent->fts_name, command_line,
+                    (ent->fts_info == FTS_D || ent->fts_info == FTS_DC
+                     || ent->fts_info == FTS_DNR)))
     {
       fts_set (fts, ent, FTS_SKIP);
       return 1;
@@ -1336,6 +1341,11 @@ grepdesc (int desc, int command_line)
       suppressible_error (filename, errno);
       goto closeout;
     }
+
+  if (desc != STDIN_FILENO && command_line
+      && skipped_file (filename, 1, S_ISDIR (st.st_mode)))
+    goto closeout;
+
   if (desc != STDIN_FILENO
       && directories == RECURSE_DIRECTORIES && S_ISDIR (st.st_mode))
     {
@@ -1360,7 +1370,7 @@ grepdesc (int desc, int command_line)
       if (!fts)
         xalloc_die ();
       while ((ent = fts_read (fts)))
-        status &= grepdirent (fts, ent);
+        status &= grepdirent (fts, ent, command_line);
       if (errno)
         suppressible_error (filename, errno);
       if (fts_close (fts) != 0)
@@ -2076,9 +2086,12 @@ main (int argc, char **argv)
         break;
 
       case EXCLUDE_OPTION:
+      case INCLUDE_OPTION:
         if (!excluded_patterns)
           excluded_patterns = new_exclude ();
-        add_exclude (excluded_patterns, optarg, EXCLUDE_WILDCARDS);
+        add_exclude (excluded_patterns, optarg,
+                     (EXCLUDE_WILDCARDS
+                      | (opt == INCLUDE_OPTION ? EXCLUDE_INCLUDE : 0)));
         break;
       case EXCLUDE_FROM_OPTION:
         if (!excluded_patterns)
@@ -2096,13 +2109,6 @@ main (int argc, char **argv)
         add_exclude (excluded_directory_patterns, optarg, EXCLUDE_WILDCARDS);
         break;
 
-      case INCLUDE_OPTION:
-        if (!included_patterns)
-          included_patterns = new_exclude ();
-        add_exclude (included_patterns, optarg,
-                     EXCLUDE_WILDCARDS | EXCLUDE_INCLUDE);
-        break;
-
       case GROUP_SEPARATOR_OPTION:
         group_separator = optarg;
         break;
diff --git a/tests/include-exclude b/tests/include-exclude
index 406e0d4..28465cb 100755
--- a/tests/include-exclude
+++ b/tests/include-exclude
@@ -19,6 +19,11 @@ grep -r --exclude='a*'    . x > out || fail=1
 sort out > k && mv k out
 compare exp-not-a out || fail=1
 
+grep -r --exclude='Rumpelstiltskin' --include='a*' --exclude='a*' . x > out ||
+  fail=1
+sort out > k && mv k out
+compare exp-not-a out || fail=1
+
 grep -r --exclude='[ab]'  . x > out || fail=1
 sort out > k && mv k out
 compare exp-not-ab out || fail=1

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=c1ac4ab87042fd0d18d6bda9db75677c7913341f


commit 58195fabc7559541b3736400e08e901011acd61f
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Sun May 6 15:50:58 2012 -0700

    exclude: process exclude and include directives in order
    
    Also, change exclude and include directives so that they apply to
    command-line arguments too.  This restores the pre-2.6 behavior,
    and fixes a bug reported by Quentin Arce in
    <http://lists.gnu.org/archive/html/bug-grep/2012-04/msg00056.html>.
    * NEWS: Document this.
    * src/main.c (included_patterns): Remove.  All uses removed.
    (skipped_file): New function.
    (grepdirent): New arg command_line; all callers changed.  This is
    needed because non-command-line files can invoke fts_open, and
    their directory entries need to be distinguished from top-level
    directory entries.  Move code into the new skipped_file function.
    (grepdesc): Check whether a command-line argument should be skipped.
    (main): --include and --exclude options now share excluded_patterns
    rather than having separate variables included_patterns and
    excluded_patterns.
    * tests/include-exclude: Add a test to detect the fixed bug.

diff --git a/NEWS b/NEWS
index eb77919..9bd7e67 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,13 @@ GNU grep NEWS                                    -*- outline -*-
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+** Bug fixes
+
+  --include and --exclude can again be combined, and again apply to
+  the command line, e.g., "grep --include='*.[ch]' --exclude='system.h'
+  PATTERN *" again reads all *.c and *.h files except for system.h.
+  [bug introduced in grep-2.6]
+
 ** Dropped features
 
   Bootstrapping with Makefile.boot has been broken since grep 2.6,
diff --git a/src/main.c b/src/main.c
index cb6da2c..b91a042 100644
--- a/src/main.c
+++ b/src/main.c
@@ -272,7 +272,6 @@ static const struct color_cap color_dict[] =
   };
 
 static struct exclude *excluded_patterns;
-static struct exclude *included_patterns;
 static struct exclude *excluded_directory_patterns;
 /* Short options.  */
 static char const short_options[] =
@@ -449,6 +448,20 @@ context_length_arg (char const *str, intmax_t *out)
     }
 }
 
+/* Return nonzero if the file with NAME should be skipped.
+   If COMMAND_LINE is nonzero, it is a command-line argument.
+   If IS_DIR is nonzero, it is a directory.  */
+static int
+skipped_file (char const *name, int command_line, int is_dir)
+{
+  return (is_dir
+          ? (directories == SKIP_DIRECTORIES
+             || (! (command_line && filename_prefix_len != 0)
+                 && excluded_directory_patterns
+                 && excluded_file_name (excluded_directory_patterns, name)))
+          : (excluded_patterns
+             && excluded_file_name (excluded_patterns, name)));
+}
 
 /* Hairy buffering mechanism for grep.  The intent is to keep
    all reads aligned on a page boundary and multiples of the
@@ -1207,11 +1220,11 @@ grep (int fd, struct stat const *st)
 }
 
 static int
-grepdirent (FTS *fts, FTSENT *ent)
+grepdirent (FTS *fts, FTSENT *ent, int command_line)
 {
   int follow, dirdesc;
-  int command_line = ent->fts_level == FTS_ROOTLEVEL;
   struct stat *st = ent->fts_statp;
+  command_line &= ent->fts_level == FTS_ROOTLEVEL;
 
   if (ent->fts_info == FTS_DP)
     {
@@ -1220,17 +1233,9 @@ grepdirent (FTS *fts, FTSENT *ent)
       return 1;
     }
 
-  if ((ent->fts_info == FTS_D || ent->fts_info == FTS_DC
-       || ent->fts_info == FTS_DNR)
-      ? (directories == SKIP_DIRECTORIES
-         || (! (command_line && filename_prefix_len != 0)
-             && excluded_directory_patterns
-             && excluded_file_name (excluded_directory_patterns,
-                                    ent->fts_name)))
-      : ((included_patterns
-          && excluded_file_name (included_patterns, ent->fts_name))
-         || (excluded_patterns
-             && excluded_file_name (excluded_patterns, ent->fts_name))))
+  if (skipped_file (ent->fts_name, command_line,
+                    (ent->fts_info == FTS_D || ent->fts_info == FTS_DC
+                     || ent->fts_info == FTS_DNR)))
     {
       fts_set (fts, ent, FTS_SKIP);
       return 1;
@@ -1336,6 +1341,11 @@ grepdesc (int desc, int command_line)
       suppressible_error (filename, errno);
       goto closeout;
     }
+
+  if (desc != STDIN_FILENO && command_line
+      && skipped_file (filename, 1, S_ISDIR (st.st_mode)))
+    goto closeout;
+
   if (desc != STDIN_FILENO
       && directories == RECURSE_DIRECTORIES && S_ISDIR (st.st_mode))
     {
@@ -1360,7 +1370,7 @@ grepdesc (int desc, int command_line)
       if (!fts)
         xalloc_die ();
       while ((ent = fts_read (fts)))
-        status &= grepdirent (fts, ent);
+        status &= grepdirent (fts, ent, command_line);
       if (errno)
         suppressible_error (filename, errno);
       if (fts_close (fts) != 0)
@@ -2076,9 +2086,12 @@ main (int argc, char **argv)
         break;
 
       case EXCLUDE_OPTION:
+      case INCLUDE_OPTION:
         if (!excluded_patterns)
           excluded_patterns = new_exclude ();
-        add_exclude (excluded_patterns, optarg, EXCLUDE_WILDCARDS);
+        add_exclude (excluded_patterns, optarg,
+                     (EXCLUDE_WILDCARDS
+                      | (opt == INCLUDE_OPTION ? EXCLUDE_INCLUDE : 0)));
         break;
       case EXCLUDE_FROM_OPTION:
         if (!excluded_patterns)
@@ -2096,13 +2109,6 @@ main (int argc, char **argv)
         add_exclude (excluded_directory_patterns, optarg, EXCLUDE_WILDCARDS);
         break;
 
-      case INCLUDE_OPTION:
-        if (!included_patterns)
-          included_patterns = new_exclude ();
-        add_exclude (included_patterns, optarg,
-                     EXCLUDE_WILDCARDS | EXCLUDE_INCLUDE);
-        break;
-
       case GROUP_SEPARATOR_OPTION:
         group_separator = optarg;
         break;
diff --git a/tests/include-exclude b/tests/include-exclude
index 406e0d4..28465cb 100755
--- a/tests/include-exclude
+++ b/tests/include-exclude
@@ -19,6 +19,11 @@ grep -r --exclude='a*'    . x > out || fail=1
 sort out > k && mv k out
 compare exp-not-a out || fail=1
 
+grep -r --exclude='Rumpelstiltskin' --include='a*' --exclude='a*' . x > out ||
+  fail=1
+sort out > k && mv k out
+compare exp-not-a out || fail=1
+
 grep -r --exclude='[ab]'  . x > out || fail=1
 sort out > k && mv k out
 compare exp-not-ab out || fail=1

-----------------------------------------------------------------------

Summary of changes:
 NEWS                  |    7 ++++++
 gnulib                |    2 +-
 src/main.c            |   52 +++++++++++++++++++++++++++---------------------
 tests/include-exclude |    5 ++++
 4 files changed, 42 insertions(+), 24 deletions(-)


hooks/post-receive
-- 
grep


From MAILER-DAEMON Sun May 06 19:19:52 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SRAk4-0002eg-49
	for mharc-grep-commit@gnu.org; Sun, 06 May 2012 19:19:52 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55352)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SRAjy-0002e7-AI
	for grep-commit@gnu.org; Sun, 06 May 2012 19:19:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SRAjt-00044U-KO
	for grep-commit@gnu.org; Sun, 06 May 2012 19:19:45 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:38689)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SRAjt-00044J-Fx
	for grep-commit@gnu.org; Sun, 06 May 2012 19:19:41 -0400
Received: from eggert by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <eggert@cs.ucla.edu>) id 1SRAjs-00025M-Sp
	for grep-commit@gnu.org; Sun, 06 May 2012 23:19:41 +0000
Date: Sun, 06 May 2012 23:19:40 +0000
Message-Id: <E1SRAjs-00025M-Sp@vcs.savannah.gnu.org>
To: grep-commit@gnu.org
Subject: grep branch, master, updated. v2.12-11-g6c4a43a
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 58195fabc7559541b3736400e08e901011acd61f
X-Git-Newrev: 6c4a43ab84bc20d39128c390d14fba36f668ad98
From: Paul Eggert <eggert@cs.ucla.edu>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.72
X-BeenThere: grep-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: bug-grep@gnu.org
List-Id: CVS commit notices for GNU grep <grep-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/grep-commit>,
	<mailto:grep-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/grep-commit>
List-Post: <mailto:grep-commit@gnu.org>
List-Help: <mailto:grep-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/grep-commit>,
	<mailto:grep-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 06 May 2012 23:19:50 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  6c4a43ab84bc20d39128c390d14fba36f668ad98 (commit)
      from  58195fabc7559541b3736400e08e901011acd61f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=6c4a43ab84bc20d39128c390d14fba36f668ad98


commit 6c4a43ab84bc20d39128c390d14fba36f668ad98
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Sun May 6 16:18:57 2012 -0700

    maint: quote 'like this' or "like this", not `like this'
    
    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.

diff --git a/ChangeLog-2009 b/ChangeLog-2009
index 894891b..fac59ff 100644
--- a/ChangeLog-2009
+++ b/ChangeLog-2009
@@ -994,7 +994,7 @@
 
 2005-01-07  Stepan Kasal  <kasal@ucw.cz>
 
-        * tests/status.sh: Added two tests--option `-s' should have no
+        * tests/status.sh: Added two tests--option '-s' should have no
           influence on the exit status.
 
 2004-12-16  Stepan Kasal  <kasal@ucw.cz>
@@ -1028,8 +1028,8 @@
 
 2004-12-01  Stepan Kasal  <kasal@ucw.cz>
 
-        * src/grep.c (usage): Use ``FILE_PATTERN'' for --include and --exclude,
-          change ``only print'' to ``print only''.
+        * src/grep.c (usage): Use "FILE_PATTERN" for --include and --exclude,
+          change "only print" to "print only".
         * doc/grep.1: Likewise; state that wildcard matching is used.
           Move some options so that they are sorted alphabetically.
         * dfa.c, NEWS: Fix typos.
@@ -1052,9 +1052,9 @@
 
 2004-11-23  Stepan Kasal  <kasal@ucw.cz>
 
-        * src/grep.c (usage): Make sure both copies of the ``usage''
-          strings match.  Add ``(C)'' to the copyright notice.
-        * src/dfa.c: Changed ``out of memory'' to ``memory exhausted'' to
+        * src/grep.c (usage): Make sure both copies of the "usage"
+          strings match.  Add "(C)" to the copyright notice.
+        * src/dfa.c: Changed "out of memory" to "memory exhausted" to
           match messages elsewhere in the source.
 
 2004-11-22  Stepan Kasal  <kasal@ucw.cz>
@@ -1081,7 +1081,7 @@
 2004-11-20  Stepan Kasal  <kasal@ucw.cz>
 
         * configure.in: Added a copyright notice (using gawk as a template).
-        (AC_INIT, AM_INIT_AUTOMAKE): Changed to the ``new'' form so that
+        (AC_INIT, AM_INIT_AUTOMAKE): Changed to the "new" form so that
           the PACKAGE_* symbols get defined correctly in config.h.
 
 2004-11-20  Stepan Kasal  <kasal@ucw.cz>
@@ -1108,7 +1108,7 @@
 
         * tests/spencer1.awk: Use only lines with 3 fields.
         * tests/spencer1.tests: Disable #55 for now.
-        * tests/ere.tests, tests/bre.tests: Add ``TO CORRECT'' to disabled
+        * tests/ere.tests, tests/bre.tests: Add "TO CORRECT" to disabled
           tests which had empty $4.
         * tests/backref.sh: Modify #2 so that current glibc regex can
           handle it in finite time.
@@ -1116,7 +1116,7 @@
 2004-11-12  Stepan Kasal  <kasal@ucw.cz>
 
         Change bug-gnu-utils address to bug-grep, on many places; there
-        is no need to have the word ``grep'' in subject then.
+        is no need to have the word "grep" in subject then.
         Thanks to Tony Abou-Assaleh and Benno Schulenberg for pointing
         out this.
 
@@ -1129,7 +1129,7 @@
 
         * src/search.c (check_multibyte_string, Gcompile, Ecompile): Replace
           malloc with xmalloc.
-        * src/dfa.c (dfamust): Replace two calls to ``malloc'' by MALLOC.
+        * src/dfa.c (dfamust): Replace two calls to 'malloc' by MALLOC.
 
 2003-07-23  Stepan Kasal  <kasal@ucw.cz>
 
@@ -1142,7 +1142,7 @@
         * src/dfa.c: remove non-constant initializers from dfa.c
 
 2003-06-16  Stepan Kasal  <kasal@ucw.cz>
-        * doc/grep.1: two typos ``--line-buffered [...] penalty''
+        * doc/grep.1: two typos "--line-buffered [...] penalty"
         * doc/grep.texi: a typo
 
 2003-06-12  Bernhard Rosenkraenzer <bero@arklinux.org>
@@ -1515,11 +1515,11 @@
 2001-03-01  Isamu Hasegawa
 
         Implement the mechanism to match with multibyte characters,
-        and use it for `period' in multibyte environments.
+        and use it for 'period' in multibyte environments.
 
         * dfa.h (mbps): new variable.
         * dfa.c (prtok): handle ANYCHAR.
-        (lex): use ANYCHAR for `period' in multibyte environments.
+        (lex): use ANYCHAR for 'period' in multibyte environments.
         (atom): handle ANYCHAR.
         (state_index): initialize mbps in multibyte environments.
         (epsclosure): handle ANYCHAR.
@@ -2166,7 +2166,7 @@
 
 2000-03-03  Jim Meyering
 
-        * regex.m4: Make sure re_compile_pattern accepts patterns like `{1'.
+        * regex.m4: Make sure re_compile_pattern accepts patterns like '{1'.
 
 2000-03-02  Alain Magloire
 
@@ -2474,13 +2474,13 @@
 
 1999-10-02  Paul Eggert
 
-        * NEWS: egrep is now equivalent to `grep -E'.
+        * NEWS: egrep is now equivalent to 'grep -E'.
         The lower bound of an interval is not optional.
         You can specify a matcher multiple types without error.
         -u and -U are now allowed on non-DOS hosts, and have no effect.
         * doc/grep.texi: Likewise.
         * doc/grep.1: Likewise.
-        Fix some troff bugs that prevented `groff' from rendering the page.
+        Fix some troff bugs that prevented 'groff' from rendering the page.
 
         * src/egrepmat.c, src/fgrepmat.c, src/grepmat.c (default_matcher):
         Remove.
@@ -2545,9 +2545,9 @@
         allocate only for regular files, since we don't know the sizes of
         other files.
         Don't bother to check whether the file offset is a multiple of the page
-        size, since we now do that just once in `reset'.
+        size, since we now do that just once in 'reset'.
         When an mmapped area would fall past the end of the file, trim it to
-        just before instead of giving up immediately and doing a `read';
+        just before instead of giving up immediately and doing a 'read';
         that avoids a worst-case behavior that could read half an mmapped file.
         Fix bug when computing offsets on hosts that don't have mmap.
 
@@ -2570,7 +2570,7 @@
         Don't assume that st_ino and st_dev must be integers;
         POSIX.1 allows them to be floating-point (!).
 
-        * src/vms_fab.h (arr_ptr): `:' -> `;' to fix typo.
+        * src/vms_fab.h (arr_ptr): ':' -> ';' to fix typo.
 
 1999-08-18  Alain Magloire
 
@@ -2616,15 +2616,15 @@
 
 1999-07-26  Paul Eggert
 
-Several GNU tools have options to process arbitrary file names, even
-file names that contain newline characters.  These include `find
--print0', `perl -0', `sort -z', and `xargs -0'.  It'd be handy if GNU
-grep also processed such file names.  Here's a proposed patch to do
-this, relative to grep 2.3c.  This patch introduces two options, one
-for the data, and one for the file names.  (Sometimes one wants
-null-terminated file names in the output, and sometimes one wants to
-process lists of null-terminated strings, and these are orthogonal
-axes.)
+	Several GNU tools have options to process arbitrary file names, even
+	file names that contain newline characters.  These include 'find
+	-print0', 'perl -0', 'sort -z', and 'xargs -0'.  It'd be handy if GNU
+	grep also processed such file names.  Here's a proposed patch to do
+	this, relative to grep 2.3c.  This patch introduces two options, one
+	for the data, and one for the file names.  (Sometimes one wants
+	null-terminated file names in the output, and sometimes one wants to
+	process lists of null-terminated strings, and these are orthogonal
+	axes.)
 
         * NEWS, doc/grep.texi: New -z or --null-data and -Z or --null options.
         * src/grep.c (long_options, usage, main): Likewise.
@@ -2807,7 +2807,7 @@ axes.)
 
         * intl/Makefile.in: Replace .o with .${ac_objext} where necessary.
         Work around a limitation of Visual C++ on Cygwin32.
-        * acconfig.h configure.in: Define `alloca' as `_alloca' when CC=cl.
+        * acconfig.h configure.in: Define 'alloca' as '_alloca' when CC=cl.
         This little hack was suggested by Ian Roxborough <irox@cygnus.com>.
         Patch forwarded by Ben Elliston.
 
@@ -2925,10 +2925,10 @@ axes.)
 
         * doc/grep.texi: I found and corrected several typos.
         I believe the GNU standards require the section that describes the
-        options to the programs to be called ``Invoking'' or ``Invoking
-        <program-name>''.  This is so users and programs can easily find
+        options to the programs to be called "Invoking" or "Invoking
+        <program-name>".  This is so users and programs can easily find
         that node in any Info file.  So I changed the name of the
-        `Options' chapter to `Invoking', and corrected the
+        "Options" chapter to "Invoking", and corrected the
         cross-references accordingly.
         I added some markup to things like file names and options.
         I added some additional index entries where that seemed useful.
@@ -3005,8 +3005,8 @@ axes.)
         the console device.
         (is_EISDIR): Don't define if already defined.  Accept a second
         argument, the file name; all callers changed.
-        (grepdir): Don't free `file', inside the loop.  Use IS_SLASH to
-        check whether `dir' needs a slash.
+        (grepdir): Don't free 'file', inside the loop.  Use IS_SLASH to
+        check whether 'dir' needs a slash.
         (grepfile): If file is a directory, set e to EISDIR.
 
 1998-11-10  Alain Magloire
@@ -3024,7 +3024,7 @@ axes.)
 
 1998-11-09  Paul Eggert
 
-        * src/grep.1: Fix `Last Change' of output by generating the date
+        * src/grep.1: Fix "Last Change" of output by generating the date
         from the RCS Id.
 
         * src/grep.c (is_EISDIR): New macro.
@@ -3059,7 +3059,7 @@ axes.)
 
 1998-11-08 Alain Magloire
 
-        * src/grep.1: `prep.ai.mit.edu' should be replaced with `gnu.org'.
+        * src/grep.1: 'prep.ai.mit.edu' should be replaced with 'gnu.org'.
         Nit from Paul Eggert.
 
 1998-11-06 Alain Magloire
@@ -3127,7 +3127,7 @@ axes.)
         (reset): Initialize it.
         (fillbuf): Use it.
         (count_matches, list_files, no_filenames, suppress_errors): New static
-        vars; formerly were local to `main'.
+        vars; formerly were local to 'main'.
         (grep): Recurse through directories if the user asks for this.
         (usage, main): Add new options.
         (main): Change some local vars to be static, as described above.
@@ -3156,14 +3156,14 @@ axes.)
         (reset): Now returns value specifying whether to skip this file.
         Stat the file if either mmap or directory-skipping is possible.
         Skip the file if it's a directory and we're skipping directories.
-        (grep): Skip the file if `reset' tells us to.
+        (grep): Skip the file if 'reset' tells us to.
         (main): If open fails because the file is a directory, and if we're
         skipping directories, don't report an error.
         Remove special case for DOS and Windows.
 
         * src/dosbuf.c (guess_type): Use the same method for guessing whether a
         file is binary as grep.c's grep does.
-        There's no longer any need to declare `bp' to be unsigned.
+        There's no longer any need to declare 'bp' to be unsigned.
 
 1998-04-26 Alain Magloire
 
@@ -3184,7 +3184,7 @@ axes.)
 
 1998-04-17 Kaveh R. Ghazi
 
-        * src/dfa.h: Don't define `const', trust autoconf to handle it.
+        * src/dfa.h: Don't define 'const', trust autoconf to handle it.
 
 1998-04-16 Alain Magloire
 
@@ -3332,7 +3332,7 @@ axes.)
         Remove the "matching a single character".
         Suggested by Harald Hanche-Olsen.
 
-        * src/grep.c (main): `-f /dev/null' now specifies no patterns
+        * src/grep.c (main): '-f /dev/null' now specifies no patterns
         and therfore matches nothing.
         Reported by Jorge Stolfi.
         Patched by Paul Eggert.
@@ -3507,7 +3507,7 @@ axes.)
 
 1997-07-17 Alain Magloire <alainm@rcsm.ee.mcgill.ca>
 
-        * src/grep.c: Cause grep to fail if `fclose (stdout)' fails.
+        * src/grep.c: Cause grep to fail if 'fclose (stdout)' fails.
         From Jim Meyering <meyering@eng.ascend.com>.
 
         * grep.c:usage() more consistency in the --help.
diff --git a/HACKING b/HACKING
index be39905..6d21d0f 100644
--- a/HACKING
+++ b/HACKING
@@ -593,5 +593,5 @@ Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
-Texts.  A copy of the license is included in the ``GNU Free
-Documentation License'' file as part of this distribution.
+Texts.  A copy of the license is included in the "GNU Free
+Documentation License" file as part of this distribution.
diff --git a/NEWS b/NEWS
index 9bd7e67..1497b92 100644
--- a/NEWS
+++ b/NEWS
@@ -420,13 +420,13 @@ Version 2.4.1
 
 Version 2.4:
 
-  - egrep is now equivalent to `grep -E' as required by POSIX,
+  - egrep is now equivalent to 'grep -E' as required by POSIX,
     removing a longstanding source of confusion and incompatibility.
-    `grep' is now more forgiving about stray `{'s, for backward
+    'grep' is now more forgiving about stray '{'s, for backward
     compatibility with traditional egrep.
 
   - The lower bound of an interval is not optional.
-    You must use an explicit zero, e.g. `x{0,10}' instead of `x{,10}'.
+    You must use an explicit zero, e.g. 'x{0,10}' instead of 'x{,10}'.
     (The old documentation incorrectly claimed that it was optional.)
 
   - The --revert-match option has been renamed to --invert-match.
@@ -438,15 +438,15 @@ Version 2.4:
   - New option --mmap.  By default, GNU grep now uses read instead of mmap.
     This is faster on some hosts, and is safer on all.
 
-  - The new option -z or --null-data causes `grep' to treat a zero byte
+  - The new option -z or --null-data causes 'grep' to treat a zero byte
     (the ASCII NUL character) as a line terminator in input data, and
     to treat newlines as ordinary data.
 
-  - The new option -Z or --null causes `grep' to output a zero byte
+  - The new option -Z or --null causes 'grep' to output a zero byte
     instead of the normal separator after a file name.
 
-  - These two options can be used with commands like `find -print0',
-    `perl -0', `sort -z', and `xargs -0' to process arbitrary file names,
+  - These two options can be used with commands like 'find -print0',
+    'perl -0', 'sort -z', and 'xargs -0' to process arbitrary file names,
     even those that contain newlines.
 
   - The environment variable GREP_OPTIONS specifies default options;
@@ -454,7 +454,7 @@ Version 2.4:
     behavior of silently skipping directories.
 
   - You can specify a matcher multiple times without error, e.g.
-    `grep -E -E' or `fgrep -F'.  It is still an error to specify
+    'grep -E -E' or 'fgrep -F'.  It is still an error to specify
     conflicting matchers.
 
   - -u and -U are now allowed on non-DOS hosts, and have no effect.
@@ -471,26 +471,26 @@ Version 2.4:
 Version 2.3:
 
   - When searching a binary file FOO, grep now just reports
-    `Binary file FOO matches' instead of outputting binary data.
+    "Binary file FOO matches" instead of outputting binary data.
     This is typically more useful than the old behavior,
-    and it is also more consistent with other utilities like `diff'.
+    and it is also more consistent with other utilities like 'diff'.
     A file is considered to be binary if it contains a NUL (i.e. zero) byte.
 
-    The new -a or --text option causes `grep' to assume that all
-    input is text.  (This option has the same meaning as with `diff'.)
+    The new -a or --text option causes 'grep' to assume that all
+    input is text.  (This option has the same meaning as with 'diff'.)
     Use it if you want binary data in your output.
 
-  - `grep' now searches directories just like ordinary files; it no longer
+  - 'grep' now searches directories just like ordinary files; it no longer
     silently skips directories.  This is the traditional behavior of
-    Unix text utilities (in particular, of traditional `grep').
-    Hence `grep PATTERN DIRECTORY' should report
-    `grep: DIRECTORY: Is a directory' on hosts where the operating system
+    Unix text utilities (in particular, of traditional 'grep').
+    Hence 'grep PATTERN DIRECTORY' should report
+    "grep: DIRECTORY: Is a directory" on hosts where the operating system
     does not permit programs to read directories directly, and
-    `grep: DIRECTORY: Binary file matches' (or nothing) otherwise.
+    "grep: DIRECTORY: Binary file matches" (or nothing) otherwise.
 
     The new -d ACTION or --directories=ACTION option affects directory handling.
-    `-d skip' causes `grep' to silently skip directories, as in grep 2.1;
-    `-d read' (the default) causes `grep' to read directories if possible,
+    '-d skip' causes 'grep' to silently skip directories, as in grep 2.1;
+    '-d read' (the default) causes 'grep' to read directories if possible,
     as in earlier versions of grep.
 
   - The MS-DOS and Microsoft Windows ports now behave identically to the
@@ -579,5 +579,5 @@ Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
-Texts.  A copy of the license is included in the ``GNU Free
-Documentation License'' file as part of this distribution.
+Texts.  A copy of the license is included in the "GNU Free
+Documentation License" file as part of this distribution.
diff --git a/README-hacking b/README-hacking
index 0fc66bf..7b4970d 100644
--- a/README-hacking
+++ b/README-hacking
@@ -18,7 +18,7 @@ Valgrind <http://valgrind.org/> is also highly recommended, if
 Valgrind supports your architecture. See also README-valgrind.
 
 While building from a just-cloned source tree may require installing a
-few prerequisites, later, a plain `git pull && make' should be sufficient.
+few prerequisites, later, a plain 'git pull && make' should be sufficient.
 
 * First GIT checkout
 
diff --git a/cfg.mk b/cfg.mk
index e277ccb..4949d3b 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -51,9 +51,9 @@ export VERBOSE = yes
 # 1127556 9e
 export XZ_OPT = -6e
 
-old_NEWS_hash = f36c60cbfbb397ed4ebd24ea0ef93261
+old_NEWS_hash = 4161c68bdef85693cf836ee31ba9a3f9
 
-# Many m4 macros names once began with `jm_'.
+# Many m4 macros names once began with 'jm_'.
 # Make sure that none are inadvertently reintroduced.
 sc_prohibit_jm_in_m4:
 	@grep -nE 'jm_[A-Z]'						\
diff --git a/configure.ac b/configure.ac
index d681dc3..dc1e582 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 dnl
-dnl autoconf input file for ``GNU grep''
+dnl autoconf input file for GNU grep
 dnl
 dnl Copyright (C) 1997-2006, 2009-2012 Free Software Foundation, Inc.
 dnl
diff --git a/doc/grep.texi b/doc/grep.texi
index 000a844..3b52a19 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -261,7 +261,7 @@ for bold red matched text, magenta file names, green line numbers,
 green byte offsets, cyan separators, and default terminal colors otherwise.
 The deprecated environment variable @env{GREP_COLOR} is still supported,
 but its setting does not have priority;
-it defaults to `01;31' (bold red)
+it defaults to @samp{01;31} (bold red)
 which only covers the color for matched text.
 @var{WHEN} is @samp{never}, @samp{always}, or @samp{auto}.
 
diff --git a/lib/colorize-w32.c b/lib/colorize-w32.c
index 7341fe2..3fcd317 100644
--- a/lib/colorize-w32.c
+++ b/lib/colorize-w32.c
@@ -173,7 +173,7 @@ print_start_colorize (char const *sgr_start, char const *sgr_seq)
 /* Clear to the end of the current line with the default attribute.
    This is needed for reasons similar to those that require the "EL to
    Right after SGR" operation on Posix platforms: if we don't do this,
-   setting the `mt', `ms', or `mc' capabilities to use a non-default
+   setting the 'mt', 'ms', or 'mc' capabilities to use a non-default
    background color spills that color to the empty space at the end of
    the last screen line in a match whose line spans multiple screen
    lines.  */
diff --git a/m4/pcre.m4 b/m4/pcre.m4
index 42d96f6..b27f467 100644
--- a/m4/pcre.m4
+++ b/m4/pcre.m4
@@ -43,5 +43,6 @@ AC_DEFUN([gl_FUNC_PCRE],
   fi
 
   AC_DEFINE_UNQUOTED([HAVE_LIBPCRE], [`test $use_pcre != yes; echo $?`],
-    [Define to 1 if you have the `pcre' library (-lpcre).])
+    [Define to 1 if you have the Perl Compatible Regular Expressions
+     library (-lpcre).])
 ])
diff --git a/src/Makefile.am b/src/Makefile.am
index 4543f62..5cc8d59 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -32,7 +32,7 @@ libgrep_a_SOURCES = kwset.c dfa.c searchutils.c dfasearch.c kwsearch.c \
 	pcresearch.c main.c
 
 # Sometimes, the expansion of $(LIBINTL) includes -lc which may
-# include modules defining variables like `optind', so libgreputils.a
+# include modules defining variables like 'optind', so libgreputils.a
 # must precede $(LIBINTL) in order to ensure we use GNU getopt.
 # But libgreputils.a must also follow $(LIBINTL), since libintl uses
 # replacement functions defined in libgreputils.a.
diff --git a/src/dfa.c b/src/dfa.c
index 96d462f..a7e263a 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -39,7 +39,7 @@
    - It's typically faster.
    Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
    only '0' through '9' are digits.  Prefer ISASCIIDIGIT to isdigit unless
-   it's important to use the locale's definition of `digit' even when the
+   it's important to use the locale's definition of "digit" even when the
    host does not conform to Posix.  */
 #define ISASCIIDIGIT(c) ((unsigned) (c) - '0' <= 9)
 
@@ -634,7 +634,7 @@ static charclass newline;
 # define is_valid_unibyte_character(c) (! (MBS_SUPPORT && btowc (c) == WEOF))
 #endif
 
-/* Return non-zero if C is a 'word-constituent' byte; zero otherwise.  */
+/* Return non-zero if C is a "word-constituent" byte; zero otherwise.  */
 #define IS_WORD_CONSTITUENT(C) \
   (is_valid_unibyte_character (C) && (isalnum (C) || (C) == '_'))
 
@@ -974,9 +974,9 @@ parse_bracket_exp (void)
           char str[BRACKET_BUFFER_SIZE];
           FETCH_WC (c1, wc1, _("unbalanced ["));
 
-          /* If pattern contains `[[:', `[[.', or `[[='.  */
+          /* If pattern contains '[[:', '[[.', or '[[='.  */
           if (c1 == ':'
-              /* TODO: handle `[[.' and `[[=' also for MB_CUR_MAX == 1.  */
+              /* TODO: handle '[[.' and '[[=' also for MB_CUR_MAX == 1.  */
               || (MB_CUR_MAX > 1 && (c1 == '.' || c1 == '=')))
             {
               size_t len = 0;
@@ -3053,11 +3053,11 @@ charset_matched:
   return match ? match_len : 0;
 }
 
-/* Check each of `d->states[s].mbps.elem' can match or not. Then return the
-   array which corresponds to `d->states[s].mbps.elem' and each element of
+/* Check each of 'd->states[s].mbps.elem' can match or not. Then return the
+   array which corresponds to 'd->states[s].mbps.elem' and each element of
    the array contains the amount of the bytes with which the element can
    match.
-   `idx' is the index from the buf_begin, and it is the current position
+   'idx' is the index from the buf_begin, and it is the current position
    in the buffer.
    Caller MUST free the array which this function return.  */
 static int *
@@ -3086,11 +3086,11 @@ check_matching_with_multibyte_ops (struct dfa *d, state_num s, size_t idx)
 }
 
 /* Consume a single character and enumerate all of the positions which can
-   be next position from the state `s'.
-   `match_lens' is the input. It can be NULL, but it can also be the output
+   be next position from the state 's'.
+   'match_lens' is the input. It can be NULL, but it can also be the output
    of check_matching_with_multibyte_ops() for optimization.
-   `mbclen' and `pps' are the output.  `mbclen' is the length of the
-   character consumed, and `pps' is the set this function enumerate.  */
+   'mbclen' and 'pps' are the output.  'mbclen' is the length of the
+   character consumed, and 'pps' is the set this function enumerate.  */
 static status_transit_state
 transit_state_consume_1char (struct dfa *d, state_num s,
                              unsigned char const **pp,
@@ -3106,15 +3106,15 @@ transit_state_consume_1char (struct dfa *d, state_num s,
      to which p points.  */
   *mbclen = (mblen_buf[*pp - buf_begin] == 0) ? 1 : mblen_buf[*pp - buf_begin];
 
-  /* Calculate the state which can be reached from the state `s' by
-     consuming `*mbclen' single bytes from the buffer.  */
+  /* Calculate the state which can be reached from the state 's' by
+     consuming '*mbclen' single bytes from the buffer.  */
   s1 = s;
   for (k = 0; k < *mbclen; k++)
     {
       s2 = s1;
       rs = transit_state_singlebyte (d, s2, (*pp)++, &s1);
     }
-  /* Copy the positions contained by `s1' to the set `pps'.  */
+  /* Copy the positions contained by 's1' to the set 'pps'.  */
   copy (&(d->states[s1].elems), pps);
 
   /* Check (input) match_lens, and initialize if it is NULL.  */
@@ -3123,7 +3123,7 @@ transit_state_consume_1char (struct dfa *d, state_num s,
   else
     work_mbls = match_lens;
 
-  /* Add all of the positions which can be reached from `s' by consuming
+  /* Add all of the positions which can be reached from 's' by consuming
      a single character.  */
   for (i = 0; i < d->states[s].mbps.nelem; i++)
     {
@@ -3190,10 +3190,10 @@ transit_state (struct dfa *d, state_num s, unsigned char const **pp)
   /* This state has some operators which can match a multibyte character.  */
   alloc_position_set (&follows, d->nleaves);
 
-  /* `maxlen' may be longer than the length of a character, because it may
+  /* 'maxlen' may be longer than the length of a character, because it may
      not be a character but a (multi character) collating element.
-     We enumerate all of the positions which `s' can reach by consuming
-     `maxlen' bytes.  */
+     We enumerate all of the positions which 's' can reach by consuming
+     'maxlen' bytes.  */
   transit_state_consume_1char (d, s, pp, match_lens, &mbclen, &follows);
 
   wc = inputwcs[*pp - mbclen - buf_begin];
diff --git a/src/dosbuf.c b/src/dosbuf.c
index bcbef16..fd3749b 100644
--- a/src/dosbuf.c
+++ b/src/dosbuf.c
@@ -175,7 +175,7 @@ dossified_pos (off_t byteno)
 
   /* Optimization: usually the file will be scanned sequentially.
      So in most cases, this byte position will be found in the
-     table near the previous one, as recorded in `out_map_idx'.  */
+     table near the previous one, as recorded in 'out_map_idx'.  */
   pos_lo = dos_pos_map[out_map_idx-1].pos;
   pos_hi = dos_pos_map[out_map_idx].pos;
 
diff --git a/src/main.c b/src/main.c
index b91a042..bc9177e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1533,15 +1533,15 @@ Output control:\n\
   -o, --only-matching       show only the part of a line matching PATTERN\n\
   -q, --quiet, --silent     suppress all normal output\n\
       --binary-files=TYPE   assume that binary files are TYPE;\n\
-                            TYPE is `binary', `text', or `without-match'\n\
+                            TYPE is 'binary', 'text', or 'without-match'\n\
   -a, --text                equivalent to --binary-files=text\n\
 "));
       printf (_("\
   -I                        equivalent to --binary-files=without-match\n\
   -d, --directories=ACTION  how to handle directories;\n\
-                            ACTION is `read', `recurse', or `skip'\n\
+                            ACTION is 'read', 'recurse', or 'skip'\n\
   -D, --devices=ACTION      how to handle devices, FIFOs and sockets;\n\
-                            ACTION is `read' or `skip'\n\
+                            ACTION is 'read' or 'skip'\n\
   -r, --recursive           like --directories=recurse\n\
   -R, --dereference-recursive  likewise, but follow all symlinks\n\
 "));
@@ -1568,7 +1568,7 @@ Context control:\n\
   -NUM                      same as --context=NUM\n\
       --color[=WHEN],\n\
       --colour[=WHEN]       use markers to highlight the matching strings;\n\
-                            WHEN is `always', `never', or `auto'\n\
+                            WHEN is 'always', 'never', or 'auto'\n\
   -U, --binary              do not strip CR characters at EOL (MSDOS/Windows)\n\
   -u, --unix-byte-offsets   report offsets as if CRs were not there\n\
                             (MSDOS/Windows)\n\
diff --git a/tests/backref b/tests/backref
index d8c75be..bd7cd02 100755
--- a/tests/backref
+++ b/tests/backref
@@ -18,8 +18,8 @@ if test $? -ne 0 ; then
         failures=1
 fi
 
-# hit hard with the `Bond' tests
-# For now, remove the `?' in the last parentheses, so that new glibc can do it.  --Stepan
+# hit hard with the 'Bond' tests
+# For now, remove the '?' in the last parentheses, so that new glibc can do it.  --Stepan
 echo "civic" | grep -E -e '^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.).?\9\8\7\6\5\4\3\2\1$' > /dev/null 2>&1
 if test $? -ne 0 ; then
         echo "Options: Bond, test #2 failed"
diff --git a/tests/help-version b/tests/help-version
index b12e3dc..65ab3e2 100755
--- a/tests/help-version
+++ b/tests/help-version
@@ -74,7 +74,7 @@ test "x$v" = "x$VERSION" \
 for lang in C fr da; do
   for i in $built_programs; do
 
-    # Skip `test'; it doesn't accept --help or --version.
+    # Skip 'test'; it doesn't accept --help or --version.
     test $i = test && continue;
 
     # false fails even when invoked with --help or --version.
@@ -84,7 +84,7 @@ for lang in C fr da; do
       continue
     fi
 
-    # The just-built install executable is always named `ginstall'.
+    # The just-built install executable is always named 'ginstall'.
     test $i = install && i=ginstall
 
     # Make sure they exit successfully, under normal conditions.
@@ -95,7 +95,7 @@ for lang in C fr da; do
     grep "$PACKAGE_BUGREPORT" h-$i > /dev/null || fail=1
     rm -f h-$i
 
-    # Make sure they fail upon `disk full' error.
+    # Make sure they fail upon 'disk full' error.
     if test -w /dev/full && test -c /dev/full; then
       env $i --help    >/dev/full 2>/dev/null && fail=1
       env $i --version >/dev/full 2>/dev/null && fail=1
@@ -107,7 +107,7 @@ for lang in C fr da; do
         : # ok
       else
         fail=1
-        echo "*** $i: bad exit status \`$status' (expected $expected)," 1>&2
+        echo "*** $i: bad exit status '$status' (expected $expected)," 1>&2
         echo "  with --help or --version output redirected to /dev/full" 1>&2
       fi
     fi
@@ -139,7 +139,7 @@ chown_setup () { args=--version; }
 mkfifo_setup () { args=--version; }
 mknod_setup () { args=--version; }
 # Punt on uptime, since it fails (e.g., failing to get boot time)
-# on some systems, and we shouldn't let that stop `make check'.
+# on some systems, and we shouldn't let that stop 'make check'.
 uptime_setup () { args=--version; }
 
 # Create a file in the current directory, not in $TMPDIR.
@@ -197,7 +197,7 @@ basename_setup () { args=$tmp_in; }
 dirname_setup () { args=$tmp_in; }
 expr_setup () { args=foo; }
 
-# Punt, in case GNU `id' hasn't been installed yet.
+# Punt, in case GNU 'id' hasn't been installed yet.
 groups_setup () { args=--version; }
 
 pathchk_setup () { args=$tmp_in; }
diff --git a/tests/tests b/tests/tests
index 6f2545f..244e5c8 100644
--- a/tests/tests
+++ b/tests/tests
@@ -19,8 +19,8 @@
 # no match for that one.  In both the fourth and fifth fields, a (sub)field
 # starting with @ indicates that the (sub)expression is expected to match
 # a null string followed by the stuff after the @; this provides a way to
-# test where null strings match.  The character `N' in REs and strings
-# is newline, `S' is space, `T' is tab, `Z' is NUL.
+# test where null strings match.  The character 'N' in REs and strings
+# is newline, 'S' is space, 'T' is tab, 'Z' is NUL.
 #
 # The full list of flags:
 #	-	placeholder, does nothing

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog-2009     |   84 ++++++++++++++++++++++++++--------------------------
 HACKING            |    4 +-
 NEWS               |   42 +++++++++++++-------------
 README-hacking     |    2 +-
 cfg.mk             |    4 +-
 configure.ac       |    2 +-
 doc/grep.texi      |    2 +-
 lib/colorize-w32.c |    2 +-
 m4/pcre.m4         |    3 +-
 src/Makefile.am    |    2 +-
 src/dfa.c          |   36 +++++++++++-----------
 src/dosbuf.c       |    2 +-
 src/main.c         |    8 ++--
 tests/backref      |    4 +-
 tests/help-version |   12 ++++----
 tests/tests        |    4 +-
 16 files changed, 107 insertions(+), 106 deletions(-)


hooks/post-receive
-- 
grep


From MAILER-DAEMON Tue May 15 12:28:24 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SUKbo-00040x-IF
	for mharc-grep-commit@gnu.org; Tue, 15 May 2012 12:28:24 -0400
Received: from eggs.gnu.org ([208.118.235.92]:36422)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SUKbg-0003mt-72
	for grep-commit@gnu.org; Tue, 15 May 2012 12:28:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SUKbZ-0007xc-3P
	for grep-commit@gnu.org; Tue, 15 May 2012 12:28:15 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:43317)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SUKbZ-0007xR-00
	for grep-commit@gnu.org; Tue, 15 May 2012 12:28:09 -0400
Received: from eggert by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <eggert@cs.ucla.edu>) id 1SUKbT-0006Jw-Tx
	for grep-commit@gnu.org; Tue, 15 May 2012 16:28:08 +0000
Date: Tue, 15 May 2012 16:28:04 +0000
Message-Id: <E1SUKbT-0006Jw-Tx@vcs.savannah.gnu.org>
To: grep-commit@gnu.org
Subject: grep branch, master, updated. v2.12-12-g582cdfa
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 6c4a43ab84bc20d39128c390d14fba36f668ad98
X-Git-Newrev: 582cdfacf297181c2c5ffec83fd8a3c0f6562fc6
From: Paul Eggert <eggert@cs.ucla.edu>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.72
X-BeenThere: grep-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: bug-grep@gnu.org
List-Id: CVS commit notices for GNU grep <grep-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/grep-commit>,
	<mailto:grep-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/grep-commit>
List-Post: <mailto:grep-commit@gnu.org>
List-Help: <mailto:grep-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/grep-commit>,
	<mailto:grep-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 15 May 2012 16:28:22 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  582cdfacf297181c2c5ffec83fd8a3c0f6562fc6 (commit)
      from  6c4a43ab84bc20d39128c390d14fba36f668ad98 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=582cdfacf297181c2c5ffec83fd8a3c0f6562fc6


commit 582cdfacf297181c2c5ffec83fd8a3c0f6562fc6
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Tue May 15 09:26:02 2012 -0700

    grep: sparse files are now considered binary
    
    * 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.

diff --git a/NEWS b/NEWS
index 1497b92..f515e84 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,11 @@ GNU grep NEWS                                    -*- outline -*-
   PATTERN *" again reads all *.c and *.h files except for system.h.
   [bug introduced in grep-2.6]
 
+** New features
+
+  'grep' without -z now treats a sparse file as binary, if it can
+  easily determine that the file is sparse.
+
 ** Dropped features
 
   Bootstrapping with Makefile.boot has been broken since grep 2.6,
@@ -45,7 +50,6 @@ GNU grep NEWS                                    -*- outline -*-
   use -R if you prefer the old behavior of following all symlinks and
   defaulting to reading all devices.
 
-
 * Noteworthy changes in release 2.11 (2012-03-02) [stable]
 
 ** Bug fixes
diff --git a/bootstrap.conf b/bootstrap.conf
index a7853c9..57749b4 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -69,6 +69,7 @@ realloc-gnu
 regex
 same-inode
 ssize_t
+stat-size
 stddef
 stdlib
 stpcpy
diff --git a/doc/grep.texi b/doc/grep.texi
index 3b52a19..0e519dd 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -580,7 +580,8 @@ this is equivalent to the @samp{--binary-files=text} option.
 @item --binary-files=@var{type}
 @opindex --binary-files
 @cindex binary files
-If the first few bytes of a file indicate that the file contains binary data,
+If a file's allocation metadata or its first few bytes
+indicate that the file contains binary data,
 assume that the file is of type @var{type}.
 By default, @var{type} is @samp{binary},
 and @command{grep} normally outputs either
@@ -722,8 +723,8 @@ better performance.
 @cindex binary files, MS-DOS/MS-Windows
 Treat the file(s) as binary.
 By default, under MS-DOS and MS-Windows,
-@command{grep} guesses the file type
-by looking at the contents of the first 32kB read from the file.
+@command{grep} guesses whether a file is text or binary
+as described for the @option{--binary-files} option.
 If @command{grep} decides the file is a text file,
 it strips the @code{CR} characters from the original file contents
 (to make regular expressions with @code{^} and @code{$} work correctly).
diff --git a/src/main.c b/src/main.c
index bc9177e..10fbfac 100644
--- a/src/main.c
+++ b/src/main.c
@@ -44,6 +44,7 @@
 #include "progname.h"
 #include "propername.h"
 #include "quote.h"
+#include "stat-size.h"
 #include "version-etc.h"
 #include "xalloc.h"
 #include "xstrtol.h"
@@ -406,6 +407,14 @@ is_device_mode (mode_t m)
   return S_ISCHR (m) || S_ISBLK (m) || S_ISSOCK (m) || S_ISFIFO (m);
 }
 
+/* Return nonzero if ST->st_size is defined.  Assume the file is not a
+   symbolic link.  */
+static int
+usable_st_size (struct stat const *st)
+{
+  return S_ISREG (st->st_mode) || S_TYPEISSHM (st) || S_TYPEISTMO (st);
+}
+
 /* Functions we'll use to search. */
 static compile_fp_t compile;
 static execute_fp_t execute;
@@ -428,6 +437,70 @@ clean_up_stdout (void)
     close_stdout ();
 }
 
+/* Return 1 if a file is known to be binary for the purpose of 'grep'.
+   BUF, of size BUFSIZE, is the initial buffer read from the file with
+   descriptor FD and status ST.  */
+static int
+file_is_binary (char const *buf, size_t bufsize, int fd, struct stat const *st)
+{
+  #ifndef HAVE_STRUCT_STAT_ST_BLOCKS
+  enum { HAVE_STRUCT_STAT_ST_BLOCKS = 0 };
+  #endif
+  #ifndef SEEK_HOLE
+  enum { SEEK_HOLE = SEEK_END };
+  #endif
+
+  /* If -z, test only whether the initial buffer contains '\200';
+     knowing about holes won't help.  */
+  if (! eolbyte)
+    return memchr (buf, '\200', bufsize) != 0;
+
+  /* If the initial buffer contains a null byte, guess that the file
+     is binary.  */
+  if (memchr (buf, '\0', bufsize))
+    return 1;
+
+  /* If the file has holes, it must contain a null byte somewhere.  */
+  if ((HAVE_STRUCT_STAT_ST_BLOCKS || SEEK_HOLE != SEEK_END)
+      && usable_st_size (st))
+    {
+      off_t cur = bufsize;
+      if (O_BINARY || fd == STDIN_FILENO)
+        {
+          cur = lseek (fd, 0, SEEK_CUR);
+          if (cur < 0)
+            return 0;
+        }
+
+      /* If the file has fewer blocks than would be needed to
+         represent its data, then it must have at least one hole.  */
+      if (HAVE_STRUCT_STAT_ST_BLOCKS)
+        {
+          off_t nonzeros_needed = st->st_size - cur + bufsize;
+          off_t full_blocks = nonzeros_needed / ST_NBLOCKSIZE;
+          int partial_block = 0 < nonzeros_needed % ST_NBLOCKSIZE;
+          if (ST_NBLOCKS (*st) < full_blocks + partial_block)
+            return 1;
+        }
+
+      /* Look for a hole after the current location.  */
+      if (SEEK_HOLE != SEEK_END)
+        {
+          off_t hole_start = lseek (fd, cur, SEEK_HOLE);
+          if (0 <= hole_start)
+            {
+              if (lseek (fd, cur, SEEK_SET) < 0)
+                suppressible_error (filename, errno);
+              if (hole_start < st->st_size)
+                return 1;
+            }
+        }
+    }
+
+  /* Guess that the file does not contain binary data.  */
+  return 0;
+}
+
 /* Convert STR to a nonnegative integer, storing the result in *OUT.
    STR must be a valid context length argument; report an error if it
    isn't.  Silently ceiling *OUT at the maximum value, as that is
@@ -559,7 +632,7 @@ fillbuf (size_t save, struct stat const *st)
          is large.  However, do not use the original file size as a
          heuristic if we've already read past the file end, as most
          likely the file is growing.  */
-      if (S_ISREG (st->st_mode))
+      if (usable_st_size (st))
         {
           off_t to_be_read = st->st_size - bufoffset;
           off_t maxsize_off = save + to_be_read;
@@ -1133,7 +1206,7 @@ grep (int fd, struct stat const *st)
 
   not_text = (((binary_files == BINARY_BINARY_FILES && !out_quiet)
                || binary_files == WITHOUT_MATCH_BINARY_FILES)
-              && memchr (bufbeg, eol ? '\0' : '\200', buflim - bufbeg));
+              && file_is_binary (bufbeg, buflim - bufbeg, fd, st));
   if (not_text && binary_files == WITHOUT_MATCH_BINARY_FILES)
     return 0;
   done_on_match += not_text;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d0d622b..7be788c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -38,6 +38,7 @@ TESTS =						\
   backref					\
   backref-multibyte-slow			\
   backref-word					\
+  big-hole					\
   big-match					\
   bogus-wctob					\
   bre						\
diff --git a/tests/big-hole b/tests/big-hole
new file mode 100755
index 0000000..47e36e1
--- /dev/null
+++ b/tests/big-hole
@@ -0,0 +1,31 @@
+#!/bin/sh
+# Check that grep --binary-file=without-match quickly skips files with holes.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+expensive_
+
+# Try to make this test not THAT expensive, on typical hosts.
+virtual_memory_KiB=10240
+if echo x | (ulimit -v $virtual_memory_KiB && grep x) >/dev/null 2>&1; then
+  ulimit -v $virtual_memory_KiB
+fi
+
+# Create a file that starts with at least a buffer's worth of text,
+# but has a big hole later.
+ten='1 2 3 4 5 6 7 8 9 10'
+x='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
+(for i in $ten; do
+   for j in $ten; do
+     for k in $ten; do
+       echo $x
+     done
+   done
+ done
+ echo x | dd bs=1024k seek=8000000
+) >8T-or-so || skip_ 'cannot create big sparse file'
+
+grep --binary-file=without-match x 8T-or-so >/dev/null
+test $? -eq 1 || fail=1
+
+Exit $fail

-----------------------------------------------------------------------

Summary of changes:
 NEWS              |    6 +++-
 bootstrap.conf    |    1 +
 doc/grep.texi     |    7 +++--
 src/main.c        |   77 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 tests/Makefile.am |    1 +
 tests/big-hole    |   31 +++++++++++++++++++++
 6 files changed, 117 insertions(+), 6 deletions(-)
 create mode 100755 tests/big-hole


hooks/post-receive
-- 
grep


From MAILER-DAEMON Wed May 16 01:48:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SUX6R-0002FK-AQ
	for mharc-grep-commit@gnu.org; Wed, 16 May 2012 01:48:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55545)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUX6O-0002Bu-Mm
	for grep-commit@gnu.org; Wed, 16 May 2012 01:48:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUX6M-00018W-F1
	for grep-commit@gnu.org; Wed, 16 May 2012 01:48:48 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:48206)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SUX6M-00018E-BU
	for grep-commit@gnu.org; Wed, 16 May 2012 01:48:46 -0400
Received: from meyering by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <jim@meyering.net>) id 1SUX6J-0000q0-UO
	for grep-commit@gnu.org; Wed, 16 May 2012 05:48:44 +0000
Date: Wed, 16 May 2012 05:48:43 +0000
Message-Id: <E1SUX6J-0000q0-UO@vcs.savannah.gnu.org>
To: grep-commit@gnu.org
Subject: grep branch, master, updated. v2.12-13-g0da5dfc
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 582cdfacf297181c2c5ffec83fd8a3c0f6562fc6
X-Git-Newrev: 0da5dfc5bf682cebcb831d7f740ff58629a827e7
From: Jim Meyering <jim@meyering.net>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.72
X-BeenThere: grep-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: bug-grep@gnu.org
List-Id: CVS commit notices for GNU grep <grep-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/grep-commit>,
	<mailto:grep-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/grep-commit>
List-Post: <mailto:grep-commit@gnu.org>
List-Help: <mailto:grep-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/grep-commit>,
	<mailto:grep-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 16 May 2012 05:48:50 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  0da5dfc5bf682cebcb831d7f740ff58629a827e7 (commit)
      from  582cdfacf297181c2c5ffec83fd8a3c0f6562fc6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=0da5dfc5bf682cebcb831d7f740ff58629a827e7


commit 0da5dfc5bf682cebcb831d7f740ff58629a827e7
Author: Jim Meyering <meyering@redhat.com>
Date:   Tue May 15 19:12:35 2012 +0200

    maint: avoid nit-picky syntax-check test failure; tweak big-hole test
    
    * NEWS: Restore deleted newline in "old" NEWS, to fix a syntax-check
    test failure.
    * tests/big-hole: Use awk, rather than a shell loop: saves 3000 lines
    of verbose shell output in the .log file.

diff --git a/NEWS b/NEWS
index f515e84..6926276 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ GNU grep NEWS                                    -*- outline -*-
   Bootstrapping with Makefile.boot has been broken since grep 2.6,
   and was removed.
 
+
 * Noteworthy changes in release 2.12 (2012-04-23) [stable]
 
 ** Bug fixes
@@ -50,6 +51,7 @@ GNU grep NEWS                                    -*- outline -*-
   use -R if you prefer the old behavior of following all symlinks and
   defaulting to reading all devices.
 
+
 * Noteworthy changes in release 2.11 (2012-03-02) [stable]
 
 ** Bug fixes
diff --git a/tests/big-hole b/tests/big-hole
index 47e36e1..20ade97 100755
--- a/tests/big-hole
+++ b/tests/big-hole
@@ -13,16 +13,8 @@ fi
 
 # Create a file that starts with at least a buffer's worth of text,
 # but has a big hole later.
-ten='1 2 3 4 5 6 7 8 9 10'
-x='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
-(for i in $ten; do
-   for j in $ten; do
-     for k in $ten; do
-       echo $x
-     done
-   done
- done
- echo x | dd bs=1024k seek=8000000
+(${AWK-awk} 'BEGIN{ for (i=0;i<1000;i++) printf "%080d\n", 0 }' < /dev/null
+  echo x | dd bs=1024k seek=8000000
 ) >8T-or-so || skip_ 'cannot create big sparse file'
 
 grep --binary-file=without-match x 8T-or-so >/dev/null

-----------------------------------------------------------------------

Summary of changes:
 NEWS           |    2 ++
 tests/big-hole |   12 ++----------
 2 files changed, 4 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
grep


From MAILER-DAEMON Wed May 16 13:23:39 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SUhwp-0006Pj-5d
	for mharc-grep-commit@gnu.org; Wed, 16 May 2012 13:23:39 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37905)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SUhwi-0006PZ-KF
	for grep-commit@gnu.org; Wed, 16 May 2012 13:23:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SUhwg-00033Z-Im
	for grep-commit@gnu.org; Wed, 16 May 2012 13:23:32 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:60391)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SUhwg-00033O-F5
	for grep-commit@gnu.org; Wed, 16 May 2012 13:23:30 -0400
Received: from eggert by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <eggert@cs.ucla.edu>) id 1SUhwg-0002OL-7I
	for grep-commit@gnu.org; Wed, 16 May 2012 17:23:30 +0000
Date: Wed, 16 May 2012 17:23:30 +0000
Message-Id: <E1SUhwg-0002OL-7I@vcs.savannah.gnu.org>
To: grep-commit@gnu.org
Subject: grep branch, master, updated. v2.12-14-g34e0ada
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 0da5dfc5bf682cebcb831d7f740ff58629a827e7
X-Git-Newrev: 34e0adabf0cd98eb4d1c4a929acf0b8238fcfbbc
From: Paul Eggert <eggert@cs.ucla.edu>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.72
X-BeenThere: grep-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: bug-grep@gnu.org
List-Id: CVS commit notices for GNU grep <grep-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/grep-commit>,
	<mailto:grep-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/grep-commit>
List-Post: <mailto:grep-commit@gnu.org>
List-Help: <mailto:grep-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/grep-commit>,
	<mailto:grep-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 16 May 2012 17:23:37 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  34e0adabf0cd98eb4d1c4a929acf0b8238fcfbbc (commit)
      from  0da5dfc5bf682cebcb831d7f740ff58629a827e7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=34e0adabf0cd98eb4d1c4a929acf0b8238fcfbbc


commit 34e0adabf0cd98eb4d1c4a929acf0b8238fcfbbc
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Wed May 16 10:23:04 2012 -0700

    grep: avoid nominal integer overflow
    
    * src/dfa.c (add_utf8_anychar): Avoid signed integer overflow.
    Although this works on all platforms we know about, strictly
    speaking the behavior is undefined, and Sun C 5.8 warns about it.

diff --git a/src/dfa.c b/src/dfa.c
index a7e263a..df73a1a 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -1630,7 +1630,7 @@ add_utf8_anychar (void)
   static const charclass utf8_classes[5] = {
     {0, 0, 0, 0, ~0, ~0, 0, 0}, /* 80-bf: non-lead bytes */
     {~0, ~0, ~0, ~0, 0, 0, 0, 0},       /* 00-7f: 1-byte sequence */
-    {0, 0, 0, 0, 0, 0, 0xfffffffcU, 0}, /* c2-df: 2-byte sequence */
+    {0, 0, 0, 0, 0, 0, ~3, 0},          /* c2-df: 2-byte sequence */
     {0, 0, 0, 0, 0, 0, 0, 0xffff},      /* e0-ef: 3-byte sequence */
     {0, 0, 0, 0, 0, 0, 0, 0xff0000}     /* f0-f7: 4-byte sequence */
   };

-----------------------------------------------------------------------

Summary of changes:
 src/dfa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
grep


