bug-grep
[Top][All Lists]
Advanced

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

Re: [patch #4604] Fix left anchors and -w problems


From: Julian Foad
Subject: Re: [patch #4604] Fix left anchors and -w problems
Date: Thu, 10 Nov 2005 16:07:03 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511

Charles Levert wrote:

Version 2.

Note that this also addresses bug #8243.

The execute() interface was changed from using a "size_t start_pos" to a
"char const *start_ptr". The "tests/fmbtest.sh" file is now also modified. The explanation in the ChangeLog entry was much expanded.

File name: sp2.patch                      Size:17 KB
\"cvs diff -u\" patch version 2
<http://savannah.gnu.org/patch/download.php?item_id=4604&item_file_id=5452>

  <http://savannah.gnu.org/patch/?func=detailitem&item_id=4604>

Excellent.

The only remaining thing is that fmbtest #5 (for -F) is now the same as #6 (for -G and -E), and it ought to have a version corresponding to #7 as well. In other words, #5 is redundant if we move #6 and #7 inside the main (F G E) loop, as per the attached patch relative to your version.

Apart from that, the code looks right so I think it's ready to commit.

- Julian
--- fmbtest.sh  2005-11-10 15:54:27.000000000 +0000
+++ fmbtest.sh  2005-11-10 15:57:36.000000000 +0000
@@ -65,22 +65,7 @@
   failures=1
 fi
 
-done
-
-# Test that -F --color=always does not depend on individual pattern order 
within the pattern
-# list, and that a longer match is preferred to a shorter one starting at the 
same point.
-test5="`echo 'Cosi tu ČišÍ...' \
-       | LC_ALL=cs_CZ.UTF-8 ${GREP} --color=always -Fi -e 'čiš' -e 
'čiší'`"
-if echo "$test5" | LC_ALL=C ${GREP} -q 'Cosi tu 
.*\[.*m\(.\[K\)\?ČišÍ.*\[.*m\(.\[K\)\?\.\.\.'; then
-  :
-else
-  echo "Test #5 F failed: $test5"
-  failures=1
-fi
-
-for mode in G E; do
-
-# Test that -{G,E} --color=always does not depend on individual pattern order 
within the pattern
+# Test that --color=always does not depend on individual pattern order within 
the pattern
 # list, and that a longer match is preferred to a shorter one starting at the 
same point.
 test6="`echo 'Cosi tu ČišÍ...' \
        | LC_ALL=cs_CZ.UTF-8 ${GREP} --color=always -${mode}i -e 'čiš' -e 
'čiší'`"
@@ -91,7 +76,7 @@
   failures=1
 fi
 
-# Test that -{G,E} --color=always does not depend on individual pattern order 
within the pattern
+# Test that --color=always does not depend on individual pattern order within 
the pattern
 # list, and that a longer match is preferred to a shorter one starting at the 
same point.
 test7="`echo 'Cosi tu ČišÍ...' \
        | LC_ALL=cs_CZ.UTF-8 ${GREP} --color=always -${mode}i -e 'čiší' -e 
'čiš'`"
@@ -102,6 +87,10 @@
   failures=1
 fi
 
+done
+
+for mode in G E; do
+
 test8="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -${mode}i -e 'Č.šE' -e 'Č[a-f]s' 
csinput \
               | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)"
 if test "$test8" != "01 02 07 08 10 11 12 13 14 15 16 17 18 19 20"; then

reply via email to

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