grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep branch, master, updated. v2.6.3-78-g9c45c19


From: Jim Meyering
Subject: grep branch, master, updated. v2.6.3-78-g9c45c19
Date: Sat, 14 Aug 2010 20:20:20 +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  9c45c193825d1f59e1d341e556ecf4adeb7a03a2 (commit)
      from  3569576a3304b51491be0a88d4659713d960674f (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=9c45c193825d1f59e1d341e556ecf4adeb7a03a2


commit 9c45c193825d1f59e1d341e556ecf4adeb7a03a2
Author: Jim Meyering <address@hidden>
Date:   Fri Aug 13 18:19:16 2010 -0500

    make --include=FILE work once again
    
    The semantics of excluded_file_name changed (when operating on
    an "included" file name list).
    * src/main.c (main): Adjust for changed semantics of excluded_file_name
    simply by removing a negation.
    * NEWS (Bug fixes): Mention this fix.
    * tests/include-exclude: Add a test for this.
    Reported by Joe Perches in http://savannah.gnu.org/bugs/?29876.

diff --git a/NEWS b/NEWS
index e64ec40..95c2e88 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@ GNU grep NEWS                                    -*- outline -*-
 
 ** Bug fixes
 
+  grep --include=FILE works once again, rather than working like --exclude=FILE
+  [bug introduced in grep-2.6]
+
   Searching with grep -Fw for an empty string would not match an
   empty line. [bug present since "the beginning"]
 
diff --git a/src/main.c b/src/main.c
index 20168bb..6c4fcd6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2172,11 +2172,11 @@ There is NO WARRANTY, to the extent permitted by 
law.\n"),
           if ((included_patterns || excluded_patterns)
               && !isdir (file))
             {
-              if (included_patterns &&
-                  ! excluded_file_name (included_patterns, file))
+              if (included_patterns
+                  && excluded_file_name (included_patterns, file))
                 continue;
-              if (excluded_patterns &&
-                  excluded_file_name (excluded_patterns, file))
+              if (excluded_patterns
+                  && excluded_file_name (excluded_patterns, file))
                 continue;
             }
           status &= grepfile (STREQ (file, "-") ? (char *) NULL : file,
diff --git a/tests/include-exclude b/tests/include-exclude
index 0192b78..8a8e86c 100644
--- a/tests/include-exclude
+++ b/tests/include-exclude
@@ -39,4 +39,8 @@ grep -r --include='a*'    . x > out || fail=1
 # no need to sort
 compare out exp-a || fail=1
 
+# --include (without --recursive) uses different code
+grep --include=a a x/* > out || fail=1
+compare out exp-a || fail=1
+
 Exit $fail

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

Summary of changes:
 NEWS                  |    3 +++
 src/main.c            |    8 ++++----
 tests/include-exclude |    4 ++++
 3 files changed, 11 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]