]> git.pld-linux.org Git - packages/grep.git/commitdiff
- this patch breaks grep:
authorJan Rękorajski <baggins@pld-linux.org>
Wed, 23 Sep 2009 07:19:09 +0000 (07:19 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
[baggins@students src]$ echo "dfa borkenes test" | GREP_USE_DFA=1 grep -IRnw borkenes
1:dfa borkenes test
[baggins@students src]$ echo "dfa borkenes test" | grep -IRnw borkenes
1:borkenes[baggins@students src]$

Changed files:
    grep-dfa-optional.patch -> 1.2

grep-dfa-optional.patch [deleted file]

diff --git a/grep-dfa-optional.patch b/grep-dfa-optional.patch
deleted file mode 100644 (file)
index 0738ff0..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-The DFA algorithm is slow with mutlibytes characters.
-This patch disables the DFA algorithm, but it can be re-enabled by setting
-the GREP_USE_DFA environment variable.
-
-This patch requires 64-egf-speedup.patch
---- src/search.c.orig  2005-09-06 22:22:17.000000000 +0200
-+++ src/search.c       2005-09-06 22:25:41.000000000 +0200
-@@ -326,6 +326,8 @@
-   char eol = eolbyte;
-   int backref, start, len;
-   struct kwsmatch kwsm;
-+  static int use_dfa;
-+  static int use_dfa_checked = 0;
-   size_t i, ret_val;
- #ifdef MBS_SUPPORT
-   int mb_cur_max = MB_CUR_MAX;
-@@ -333,6 +335,26 @@
-   memset (&mbs, '\0', sizeof (mbstate_t));
- #endif /* MBS_SUPPORT */
-+  if (!use_dfa_checked)
-+    {
-+      char *grep_use_dfa = getenv ("GREP_USE_DFA");
-+      if (!grep_use_dfa)
-+      {
-+#ifdef MBS_SUPPORT
-+        /* Turn off DFA when processing multibyte input. */
-+        use_dfa = (MB_CUR_MAX == 1);
-+#else
-+        use_dfa = 1;
-+#endif /* MBS_SUPPORT */
-+      }
-+      else
-+      {
-+        use_dfa = atoi (grep_use_dfa);
-+      }
-+
-+      use_dfa_checked = 1;
-+    }
-+
-   buflim = buf + size;
-   for (beg = end = buf; end < buflim; beg = end)
-@@ -400,7 +422,8 @@
- #endif /* MBS_SUPPORT */
-                 (kwsm.index < kwset_exact_matches))
-               goto success;
--            if (dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1)
-+            if (use_dfa &&
-+                dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1)
-               continue;
-           }
-         else
-@@ -409,7 +432,9 @@
- #ifdef MBS_SUPPORT
-             size_t bytes_left = 0;
- #endif /* MBS_SUPPORT */
--            size_t offset = dfaexec (&dfa, beg, buflim - beg, &backref);
-+            size_t offset = 0;
-+            if (use_dfa)
-+              offset = dfaexec (&dfa, beg, buflim - beg, &backref);
-             if (offset == (size_t) -1)
-               break;
-             /* Narrow down to the line we've found. */
-@@ -451,7 +476,7 @@
-               --beg;
-           }
-         /* Successful, no backreferences encountered! */
--        if (!backref)
-+        if (use_dfa && !backref)
-           goto success;
-       }
-       else
This page took 0.127143 seconds and 4 git commands to generate.